欢迎来到云服务器

服务器租用

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 prematurely closed 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 or directory), 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 in php5-cgi[8048000+4c
c000]


呈现这种问题的原因:# ab -c 1000 -n 10000 http://www.hichina.com/list/index/rcreated/

在用ab测试之前:
[email protected]:/var/log# netstat -anp
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.0.0.1:10080         0.0.0.0:*               LISTEN      4145/php-cgi   
在用ab测试之后:
[email protected]:/var/log# netstat -anp|more
Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
tcp        0      0 127.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 file size          (blocks, -c) 0
data seg size           (kbytes, -d) unlimited
scheduling priority             (-e) 0
file size               (blocks, -f) unlimited
pending signals                 (-i) 16382
max locked memory       (kbytes, -l) 64
max memory size         (kbytes, -m) unlimited
open files                      (-n) 1024
pipe size            (512 bytes, -p) 8
POSIX message queues     (bytes, -q) 819200
real-time priority              (-r) 0
stack size              (kbytes, -s) 8192
cpu time               (seconds, -t) unlimited
max user processes              (-u) unlimited
virtual memory          (kbytes, -v) unlimited
file locks                      (-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: Too many 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 1024 worker_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"

腾讯云代理

Copyright © 2003-2021 MFISP.COM. 国外vps服务器租用 梦飞云服务器租用 版权所有 粤ICP备11019662号