[Linux] nginx记录多种响应时间

[Linux] nginx记录多种响应时间,第1张

概述官网介绍$request_time – Full request time, starting when NGINX reads the first byte from the client and

官网介绍
$request_time – Full request time,starting when Nginx reads the first byte from the clIEnt and ending when Nginx sends the last byte of the response body
$upstream_connect_time – Time spent establishing a connection with an upstream server
$upstream_header_time – Time between establishing a connection to an upstream server and receiving the first byte of the response header
$upstream_response_time – Time between establishing a connection to an upstream server and receiving the last byte of the response body


$upstream_connect_time 是建立连接的时间
$upstream_header_time 从建立连接到发送第一个响应头字节的时间
$request_times 是从请求到建立连接到发送完最后一个内容字节的时间
$upstream_response_time 是从建立连接到发送完最后一个内容字节的时间,这个是我们需要关注的,因为客户端的请求和客户所在网络有关

使用下面这个日志格式,看的参数比较全

log_format apm '[$time_local]\tclIEnt=$remote_addr\t'               request="$request"\t request_length=$request_length\thttp_referer="$http_referer"\tbytes_sent=$bytes_sent\tbody_bytes_sent=$body_bytes_sent\tuser_agent="$http_user_agent"\tupstream_addr=$upstream_addr\tupstream_status=$upstream_status\tcookie="$http_cookie"\trequest_body="$request_body"\tdocument_root="$document_root"\tfastcgi_script_name="$fastcgi_script_name"\trequest_filename="$request_filename"\trequest_time=$request_time\tupstream_response_time=$upstream_response_time\tupstream_connect_time=$upstream_connect_time\tupstream_header_time=$upstream_header_time\t';
[03/Dec/2019:19:18:43 +0800]    clIEnt=10.222.128.170   request="POST /wa.PHP?a=List_folder&calltype=auto http/1.1"      request_length=959    http_referer=http://webmail.sina.net/classic/index.PHP" bytes_sent=630  body_bytes_sent=84      user_agent=Mozilla/5.0 (windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML,like Gecko) Chrome/63.0.3239.132 Safari/537.36"      upstream_addr=127.0.0.1:9000    upstream_status=200     cookie=language=cn; __guID=253826190.3237372183145944600.1575355793588.1697; _ga=GA1.2.1940556535 mon=0; monitor_count=7"     request_body=sactioncount="    document_root=/usr/local/sinamail/web" fastcgi_script_name=/wa.PHP"  request_filename=/usr/local/sinamail/web/wa.PHP"        request_time=0.133      upstream_response_time=0.133    upstream_connect_time=0.000    upstream_header_time=0.133

 

总结

以上是内存溢出为你收集整理的[Linux] nginx记录多种响应时间全部内容,希望文章能够帮你解决[Linux] nginx记录多种响应时间所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/yw/1014566.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-05-22
下一篇 2022-05-22

发表评论

登录后才能评论

评论列表(0条)

保存