查看tcp链接数
netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}'
nginx中打印耗时配置:
http {
log_format main '$time_iso8601 $msec $remote_addr $host:$server_port $upstream_addr $request_time $request_length $body_bytes_sent $request_method $request_uri $status "$http_x_forwarded_for" "$http_referer" "$http_user_agent"';
}
查看耗时:
cat host.access.log | awk -F ' ' '{if($6>0.04) print $5}' |sort |uniq -c
一般redis 总链接是不超过1000
jstack 查看一下每个线程的情况
netstat -anlp



