- 统计最大tps:
sudo awk -F "|" '{print $1}' nginx_log_file|cut -c 14-21| sort|uniq -c |sort -nr -k 1|head -n 1
- 统计平均tps:
sudo awk -F "|" '{print $1}' nginx_log_file|cut -c 14-21| sort|uniq -c |sort -nr -k 1|awk '{sum+=$1} END {print sum/NR}'
- nginx日志长这样:
[$time_local]|User_request_status:$status|$request_time|$body_bytes_sent|$remote_addr|$http_x_forwarded_for|$request_method|[$host]|$request_uri|[$http_user_agent]|[$http_accept_encoding]|[$http_referer]|$proxy_add_x_forwarded_for|$upstream_addr|Server_status:$upstream_status|$upstream_response_time
网友评论