nginx request_time

Posted by 夏泽民

1、request_time 官网描述:request processing time in seconds with a milliseconds resolution; time elapsed between the first bytes were read from the client and the log write after the last bytes were sent to the client 。 指的就是从接受用户请求的第一个字节到发送完响应数据的时间,即包括接收请求数据时间、程序响应时间、输出响应数据时间。

2、upstream_response_time 官网描述:keeps times of responses obtained from upstream servers; times are kept in seconds with a milliseconds resolution. Several response times are separated by commas and colons like addresses in the $upstream_addr variable

是指从Nginx向后端(php-cgi)建立连接开始到接受完数据然后关闭连接为止的时间。

从上面的描述可以看出,$request_time肯定大于等于$upstream_response_time,特别是使用POST方式传递参数时,因为Nginx会把request body缓存住,接受完毕后才会把数据一起发给后端。所以如果用户网络较差,或者传递数据较大时,$request_time会比$upstream_response_time大很多。

所以如果使用nginx的accesslog查看php程序中哪些接口比较慢的话,记得在log_format中加入$upstream_response_time。

根据引贴对官网描述的翻译: upstream_response_time:从 Nginx 建立连接 到 接收完数据并关闭连接 request_time:从 接受用户请求的第一个字节 到 发送完响应数据



mysql instant add colum

Posted by 夏泽民

“Instant ADD COLUMN”,即“瞬加字段功能” 鹅厂工程师通过扩展MySQL InnoDB的存储格式,可以把原来几个小时才能完成的给表加字段命令,在1秒之内执行完成,更新TB级的表都是毛毛雨,有效地提高了数据库的管理效率,降低运维成本。 随着MySQL新版本的发布,陈福荣和梁飞龙将该特性提交到MySQL 8.0.12



mysql ddl-ghost

Posted by 夏泽民

GHOST工作原理:



TIME_WAIT和CLOSE_WAIT

Posted by 夏泽民
netstat -n awk ‘/^tcp/ {++S[$NF]} END {for(a in S) print a, S[a]}’


netpoller

Posted by 夏泽民

Go中网络交互采用多路复用的技术,具体到各个平台,即Kqueue、Epoll、Select、Poll等,下面以Linux下的Epoll实现为例进行分析。



Search

Popular posts

Anything in here will be replaced on browsers that support the canvas element

Recent posts

This blog is maintained by 夏泽民

Get in touch with me at 465474307@qq.com

Subscribe to our mailing list

* indicates required