# more Nginx/error.log
2010/08/18 14:42:19 [ERROR] 18256#0: *264534 readv () failed (104:connection reset by Peer) W Hile reading upstream, client:6.217.2
36.22, server:wo.china.com, Request: "get/list/index/rcreated/http/1.0", UPS Tream: "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.C hina.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 14:42:18 w23 kernel: [2524799.982979] php-cgi[30124]: segfault at the IP 082da5bf SP BFD89C50 error 4 in php5-cgi[80 48000+4c
C000]
The reason for this problem: # ab-c 1000-n 10000 http://www.hichina.com/list/index/rcreated/
Before you use AB test:
root@web23:/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
After the AB test:
root@web23:/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
Description: The same as the CGI PID after the AB test, it is not said on the internet that "due to php-cgi restart or CGI process dead."
$ 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 (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 stress test, problem and cause:
# 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" (more than the number of CGI processes)
2010/08/26 10:53:16 [alert] 15016#0: *4644 1024 worker_connections are not enough while connecting to upstream, client:19 2.168.206.120, Server:
localhost, request: "get/http/1.0", Upstream: "fastcgi://127.0.0.1:10080", Host: "192.168.206.121" (Increase Worker_ Number of connections)
2010/08/26 17:26:21 [ERROR] 12936#0: *685388 Connect () failed (111:connection refused) while connecting to upstream, Clie nt: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"