[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]\tclient=$remote_addr\t'
'request="$request"\t request_length=$request_length\t'
'http_referer="$http_referer"\t'
'bytes_sent=$bytes_sent\t'
'body_bytes_sent=$body_bytes_sent\t'
'user_agent="$http_user_agent"\t'
'upstream_addr=$upstream_addr\t'
'upstream_status=$upstream_status\t'
'cookie="$http_cookie"\t'
'request_body="$request_body"\t'
'document_root="$document_root"\t'
'fastcgi_script_name="$fastcgi_script_name"\t'
'request_filename="$request_filename"\t'
'request_time=$request_time\t'
'upstream_response_time=$upstream_response_time\t'
'upstream_connect_time=$upstream_connect_time\t'
'upstream_header_time=$upstream_header_time\t';
[/Dec/::: +] client=10.222.128.170 request="POST /wa.php?a=list_folder&calltype=auto HTTP/1.1" request_length= http_referer="http://webmail.sina.net/classic/index.php" bytes_sent= body_bytes_sent= 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: upstream_status= 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: 封禁IP的办法【转】
今天,我们的一台服务器出了问题: 被若干IP地址访问某个接口,该接口会发送短信. 所以,我们可以做两件事: 1. nginx的层面封IP . 2 linux server的层面封IP 先看ngin ...
- linux nginx 启动脚本
linux nginx 启动脚本 [root@webtest76 ~]# vi /etc/init.d/nginx #!/bin/bash # nginx Startup script for the ...
- Linux nginx日志按天分割实例
Linux nginx日志按天分割实例 nginx的日志有个小缺点,日志文件一直就是一个,不会自动地进行切割,如果访问量很大的话,将导致日志文件非常大,不便于管理这就需要我们自己来实现了,按日期每 ...
- Arch Linux 安装记录
Arch Linux 安装记录 基本上参考wiki上的新手指南,使用arch 2014.6.1 iso安装 设置网络 有线网络 Arch Linux 默认开启DHCP. 静态ip 首先关闭DHCP:s ...
- linux+nginx+tomcat负载均衡,实现session同步
linux+nginx+tomcat负载均衡,实现session同步 花了一个上午的时间研究nginx+tomcat的负载均衡测试,集群环境搭建比较顺利,但是session同步的问题折腾了几个小时才搞 ...
- MacOS + Linux + Nginx
Asp.Net Core 发布和部署( MacOS + Linux + Nginx ) 前言 在上篇文章中,主要介绍了 Dotnet Core Run 命令,这篇文章主要是讲解如何在Linux中,对 ...
- nginx记录响应与POST请求日志
生产环境中的某些api出现故障,但是问题无法重现,但是又很想解决掉问题以及我们新项目上线,需要跟踪请求与响应的信息,可以预先找到一些bug,减少大面积的损失. 安装nginx与ngx_lua 响应日志 ...
- 莱特币ltc在linux下的多种挖矿方案详解
莱特币ltc在linux下的多种挖矿方案详解 4.0.1 Nvidia显卡Linux驱动Nvidia全部驱动:http://www.nvidia.cn/Download/index.aspx?lang ...
- PHP 的解压缩ZipArchive中的extractTo()方法 LINUX+nginx环境中解压zip时文件丢失的问题
在项目中要用ZipArchive解压ZIP文件,起初測试环境在WINDOWS平台中,測试通过,换到 LINUX+nginx 的环境中时 就出问题了(ZIP包中有文件和目录一共3百多个文件,大部分是带汉 ...
随机推荐
- TypeScript 参数属性
假设类中创建的 readonly 类型的属性,该类型的属性只能在声明处或构造器中进行初始化. class Octopus { readonly name: string; readonly numbe ...
- 了解Bootstrap和开发响应式网站
什么是Bootstrap? Bootstrap是Twitter推出的一个开源的用于web前端开发的工具包.它由Twitter的设计师Mark Otto和Jacob Thornton合作开发,是一个CS ...
- MySQL Aborted_clients和 Aborted_connects状态变量详解
Aborted_clients和 Aborted_connects状态变量详解 By:授客 QQ:1033553122 状态变量定义 Aborted_clients 因客户端消亡时未恰当的关闭连接 ...
- redis cluster集群动态伸缩--删除主从节点
目标:从集群中剔除一组主从(5007,5008) 经过上一节增加5007,5008主从服务节点后,目前集群的情况是这样的: b3363a81c3c59d57143cd3323481259c044e66 ...
- CG-CTF SQL注入
SQL注入1 题目 访问题目网址 先查看一下源码 仔细分析一下核心源码 <?php if($_POST[user] && $_POST[pass]) { //判断user和pas ...
- Node.js上传文件出现Unexpected field
上传文件时,input框的name值要与node接口中single(' ')中的参数一致,否则会报"意外字段的错" 前端用的layui 后端node接口
- IntelliJ IDEA安装与使用
官网:https://www.jetbrains.com/ 点击 点击下载 点击
- 【洛谷5492】[PKUWC2018] 随机算法(状压DP)
点此看题面 大致题意: 用随机算法求一张图的最大独立集:每次随机一个排列,从前到后枚举排列中的点,如果当前点加入点集中依然是独立集,就将当前点加入点集中,最终得到的点集就是最大独立集.求这个随机算法的 ...
- java之instanceof操作符
a intanceof A:判断a是否是类A的的一个实例,返回值为boolean public class Person extends Object{} public class Student e ...
- ReactNative: 使用Touchable触摸类组件
一.简介 在应用程序中,最灵魂的功能就是交互.通过给应用程序的组件添加事件来实现交互,进而提高用户体验.然而,ReactNative并不能像Web开发那样可以给大多数的标签元素绑定click事件,例如 ...