Open karszawa opened 6 years ago
alpでアクセスログの解析を行う。
どのパスへのアクセスが遅いか確認するため
nginx.conf に対し以下を追記
log_format ltsv "time:$time_local" "\thost:$remote_addr" "\tforwardedfor:$http_x_forwarded_for" "\treq:$request" "\tstatus:$status" "\tmethod:$request_method" "\turi:$request_uri" "\tsize:$body_bytes_sent" "\treferer:$http_referer" "\tua:$http_user_agent" "\treqtime:$request_time" "\tcache:$upstream_http_x_cache" "\truntime:$upstream_http_x_runtime" "\tapptime:$upstream_response_time" "\tvhost:$host";
access_log /var/log/nginx/access.log ltsv;
その上で、
sudo alp -f /var/log/nginx/access.log
とすると、どのアクセスパスが遅いか判別できる。
なにをやるか
alpでアクセスログの解析を行う。
なぜやるか
どのパスへのアクセスが遅いか確認するため
どうやるか
nginx.conf に対し以下を追記
その上で、
とすると、どのアクセスパスが遅いか判別できる。