标题: Nginx错误日志分析 [打印本页] 作者: 360网站管家 时间: 2015-10-13 14:18 标题: Nginx错误日志分析 # more nginx/error.log
2010/08/18 14:42:19 [error] 18256#0: *264534 readv() failed (104:Connection reset by peer) while reading upstream, client:6.217.2
36.22, server: wo.china.com, request: "GET /list/index/rcreated/HTTP/1.0", upstream: "fastcgi://127.0.0.1:10080", host:"www.hichi
na.com"
2010/08/18 14:46:55 [error] 18254#0: *272781 upstream prematurelyclosed connection while reading response header from upstream,cli
ent: 6.217.236.22, server: wo.china.com, request: "GET /top/HTTP/1.0", upstream: "fastcgi://127.0.0.1:10080", host:"www.hichina.
com"
2010/08/18 14:46:55 [error] 18254#0: *272781 open()"/var/www/nginx-default/50x.html" failed (2: No such file ordirectory), client:
6.217.236.22, server: wo.china.com, request: "GET /top/HTTP/1.0", upstream: "fastcgi://127.0.0.1:10080", host:"www.hichina.com"
# more kern.log
Aug 18 14:42:18 w23 kernel: [2524799.982979] php-cgi[30124]:segfault at 45 ip 082da5bf sp bfd89c50 error 4 inphp5-cgi[8048000+4c
c000]
出现这种问题的原因:# ab -c 1000 -n 10000http://www.hichina.com/list/index/rcreated/
在用ab测试之前:
root@web23:/var/log# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q LocalAddress Foreign Address State PID/Program name
tcp 0 0127.0.0.1:10080 0.0.0.0:* LISTEN 4145/php-cgi
在用ab测试之后:
root@web23:/var/log# netstat -anp|more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q LocalAddress Foreign Address State PID/Program name
tcp 0 0127.0.0.1:10080 0.0.0.0:* LISTEN 4145/php-cgi
说明:在用ab测试后cgi的pid相同,说明不是网上说的“由于php-cgi重启或者cgi进程死掉造成的”
$ ps aux|grep php-cgi|wc
514 5655 42144