zoukankan      html  css  js  c++  java
  • [Linux] nginx记录多种响应时间

    官网介绍
    $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]	client=$remote_addr	'
                   'request="$request"	 request_length=$request_length	'
                   'http_referer="$http_referer"	'
                   'bytes_sent=$bytes_sent	'
                   'body_bytes_sent=$body_bytes_sent	'
                   'user_agent="$http_user_agent"	'
                   'upstream_addr=$upstream_addr	'
                   'upstream_status=$upstream_status	'
                   'cookie="$http_cookie"	'
                   'request_body="$request_body"	'
                   'document_root="$document_root"	'
                   'fastcgi_script_name="$fastcgi_script_name"	'
                   'request_filename="$request_filename"	'
                   'request_time=$request_time	'
                   'upstream_response_time=$upstream_response_time	'
                   'upstream_connect_time=$upstream_connect_time	'
                   'upstream_header_time=$upstream_header_time	';
    [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
  • 相关阅读:
    asp.net在线压缩和解压缩的实现 VS2005
    Office组件配置
    您无权查看或编辑目前 F:\XXX 的权限设置;但是,您可以取得所有权或更改审核设置
    23条心灵寄语献给在创业一线的兄弟姐妹
    IIS 环境下 w3wp.exe 进程 CPU 占用过高的解决方案
    SQLServer修改表所有者
    走出软件作坊推荐
    Asp.net 的 服务器推技术 (Server Push)
    上海火车站售票点
    Newtonsoft.Json.dll 本地调用正常,服务器调用不正常
  • 原文地址:https://www.cnblogs.com/taoshihan/p/11978842.html
Copyright © 2011-2022 走看看