- 論壇徽章:
- 0
|
本帖最后由 wlong2000joint 于 2011-11-13 18:51 編輯
如題截圖如下:
nginx_trouble.JPG (173.52 KB, 下載次數(shù): 8)
下載附件
2011-11-13 18:26 上傳
問(wèn)題|故障現(xiàn)象:
有2個(gè)nginx worker進(jìn)程掛起,CPU負(fù)載達(dá)到100%,持續(xù)很長(zhǎng)時(shí)間(已經(jīng)好幾天,如果不kill nginx進(jìn)程,估計(jì)會(huì)一直持續(xù)下去,即使已經(jīng)沒(méi)有用戶請(qǐng)求|訪問(wèn))。
[root@host-22 ~]# ps aux|grep -e nginx -e CPU
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 936 0.0 0.0 49360 7584 ? Ss Nov11 2:30 nginx: master process /usr/local/nginx/sbin/nginx
www 1130 99.9 0.0 55764 13472 ? R Nov11 2590:02 nginx: worker process
www 1216 99.9 0.0 53668 11092 ? R Nov11 2585:57 nginx: worker process
www 29538 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29539 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29540 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29541 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29542 0.0 0.0 50848 9024 ? S 18:25 0:00 nginx: worker process
www 29543 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29544 0.0 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
www 29545 0.3 0.0 50848 8832 ? S 18:25 0:00 nginx: worker process
root 29551 0.0 0.0 61168 812 pts/0 R+ 18:25 0:00 grep -e nginx -e CPU
[root@host-22 ~]#curl http://127.0.0.1/server_status
Active connections: 647
server accepts handled requests
2088654 2088654 2089763
Reading: 5 Writing: 637 Waiting: 5
上面這個(gè)Writing的數(shù)字,持續(xù)好幾天了都不變,即使已經(jīng)沒(méi)有用戶訪問(wèn)。另外試過(guò)strace -p 1130,沒(méi)有任何輸出,這些在截圖上也有。
操作系統(tǒng)環(huán)境:
[root@host-22 ~]# lsb_release -a
LSB Version: :core-3.1-amd64:core-3.1-ia32:core-3.1-noarch:graphics-3.1-amd64:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description: CentOS release 5.5 (Final)
Release: 5.5
Codename: Final
[root@host-22 ~]#
[root@host-22 ~]#
[root@host-22 ~]# uname -a
Linux host-22 2.6.18-194.el5 #1 SMP Fri Apr 2 14:58:14 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[root@host-22 ~]#
[root@host-22 ~]#
nginx 版本及編譯參數(shù):
[root@host-22 ~]# /usr/local/nginx/sbin/nginx -V
nginx: nginx version: nginx/1.0.4
nginx: built by gcc 4.1.2 20080704 (Red Hat 4.1.2-46)
nginx: TLS SNI support disabled
nginx: configure arguments: ####這一行有敏感字符,大家看圖片吧####
[root@host-22 ~]#
nginx 反向代理配置:
worker_processes 8;
events {
use epoll;
worker_connections 5120;
}
http {
sendfile on;
keepalive_timeout 15;
...
upstream 2012_servers {
server 10.0.7.5:80 max_fails=2 fail_timeout=30s;
server 10.0.7.6:80 max_fails=2 fail_timeout=30s;
server 10.0.7.7:80 max_fails=2 fail_timeout=30s;
server 10.0.7.8:80 max_fails=2 fail_timeout=30s;
}
server {
listen 80;
server_name test.2012.com ;
...
location / {
include proxy.conf;
proxy_pass http://2012_servers;
}
...
}
很合法的配置呀!真不明白怎么會(huì)有nginx worker進(jìn)程hang住。。。。 |
|