360°网站管家_运维学院_提供最新最全的服务器运维视频教程与网站维护视频教程

 找回密码
 快速注册

QQ登录

只需一步,快速开始

搜索
热搜: 活动 交友 discuz
1 2 3 4
查看: 2904|回复: 0
打印 上一主题 下一主题

Nginx错误日志分析

[复制链接]

823

主题

909

帖子

4623

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
4623
跳转到指定楼层
楼主
发表于 2015-10-13 14:18:55 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

亲!这问题您也搜索很久了吧?不如咨询下我们吧


613049616  613049616  613049616   613049616   613049616


# 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

# ulimit -a
core filesize          (blocks,-c) 0
data segsize          (kbytes, -d) unlimited
schedulingpriority            (-e) 0
filesize              (blocks, -f) unlimited
pendingsignals                (-i) 16382
max locked memory       (kbytes, -l)64
max memory size        (kbytes, -m) unlimited
openfiles                     (-n) 1024
pipesize           (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-timepriority             (-r) 0
stacksize             (kbytes, -s) 8192
cputime              (seconds, -t) unlimited
max userprocesses             (-u) unlimited
virtualmemory         (kbytes, -v) unlimited
filelocks                     (-x) unlimited


ab压力测试,问题及原因:
# ab  -c 515 -n 1000 http://192.168.206.121/
2010/08/26 10:35:03 [alert] 13342#0: *8353 socket() failed (24: Toomany open files) while connecting to upstream, client:192.168.206.120,
server: localhost, request: "GET / HTTP/1.0", upstream:"fastcgi://127.0.0.1:10080", host:"192.168.206.121"(超过了cgi进程的个数)

2010/08/26 10:53:16 [alert] 15016#0: *4644 1024worker_connections are not enough while connecting to upstream,client: 192.168.206.120, server:
localhost, request: "GET / HTTP/1.0", upstream:"fastcgi://127.0.0.1:10080", host:"192.168.206.121"(增加worker_connections的数量)

2010/08/26 17:26:21 [error] 12936#0: *685388 connect() failed(111: Connection refused) while connecting to upstream, client:192.168.206.121,
server: localhost, request: "GET /info.php HTTP/1.0", upstream:"fastcgi://127.0.0.1:10080", host: "192.168.206.121"
分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
收藏收藏
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 快速注册

本版积分规则


Archiver|手机版|小黑屋|360wzgj Inc. 百度统计

GMT+8, 2024-11-1 16:28 , Processed in 0.075710 second(s), 30 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表