Nginx + PHP FastCGI 结构中的错误[WARNING] fpm_stdio_child_said()

Nginx + PHP FastCGI 结构中的错误[WARNING] fpm_stdio_child_said()

Nginx + PHP FastCGI 问题!

PHP 5.2.8 (cli) (built: Dec 18 2008 17:07:40)
Copyright (c) 1997-2008 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologies
    with eAccelerator v0.9.5.3, Copyright (c) 2004-2006 eAccelerator, by eAccelerator

redhat as4 x64 OS

目前我们的BBS跑在这台结构上,在每天早上八点并发非常高,达到五百多,平时也就几十个并发!

基本要一个小时就降下来了.


在Nginx 日志中发现很多 http 1.0 499 的错误!

在php fpm日志中:
Feb 05 09:26:40.021385 [WARNING] fpm_stdio_child_said(), line 167: child 3506 (pool default) said into stderr: "Feb 05 09:26:39.902098 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021399 [WARNING] fpm_stdio_child_said(), line 167: child 3505 (pool default) said into stderr: "Feb 05 09:26:39.901068 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021411 [WARNING] fpm_stdio_child_said(), line 167: child 3504 (pool default) said into stderr: "Feb 05 09:26:39.900091 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021423 [WARNING] fpm_stdio_child_said(), line 167: child 3503 (pool default) said into stderr: "Feb 05 09:26:39.899033 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021434 [WARNING] fpm_stdio_child_said(), line 167: child 3502 (pool default) said into stderr: "Feb 05 09:26:39.897976 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021446 [WARNING] fpm_stdio_child_said(), line 167: child 3501 (pool default) said into stderr: "Feb 05 09:26:39.896965 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021458 [WARNING] fpm_stdio_child_said(), line 167: child 3500 (pool default) said into stderr: "Feb 05 09:26:39.895947 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021469 [WARNING] fpm_stdio_child_said(), line 167: child 3499 (pool default) said into stderr: "Feb 05 09:26:39.895359 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021481 [WARNING] fpm_stdio_child_said(), line 167: child 3498 (pool default) said into stderr: "Feb 05 09:26:39.894365 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:26:40.021493 [WARNING] fpm_stdio_child_said(), line 167: child 3497 (pool default) said into stderr: "Feb 05 09:26:39.893403 [ERROR] fpm_unix_init_child(), line 168: setrlimit(RLIMIT_NOFILE) failed: Invalid argument (22)"
Feb 05 09:13:09.603827 [NOTICE] fpm_children_make(), line 352: child 3293 (pool default) started
Feb 05 09:13:09.604856 [NOTICE] fpm_children_make(), line 352: child 3294 (pool default) started
Feb 05 09:13:09.605872 [NOTICE] fpm_children_make(), line 352: child 3295 (pool default) started
Feb 05 09:13:09.606238 [NOTICE] fpm_children_make(), line 352: child 3296 (pool default) started
Feb 05 09:13:09.607581 [NOTICE] fpm_children_make(), line 352: child 3297 (pool default) started
Feb 05 09:13:09.608598 [NOTICE] fpm_children_make(), line 352: child 3298 (pool default) started
Feb 05 09:13:09.609501 [NOTICE] fpm_children_make(), line 352: child 3299 (pool default) started
Feb 05 09:13:09.610785 [NOTICE] fpm_children_make(), line 352: child 3300 (pool default) started
Feb 05 09:13:09.611807 [NOTICE] fpm_children_make(), line 352: child 3301 (pool default) started
Feb 05 09:13:09.611834 [NOTICE] fpm_event_loop(), line 107: libevent: entering main loop


但当时系统负载基本空闲:
top - 09:12:54 up 96 days, 18:16,  4 users,  load average: 0.25, 0.12, 0.06
Tasks: 233 total,   2 running, 229 sleeping,   0 stopped,   2 zombie
Cpu(s):  0.4% us,  0.2% sy,  0.0% ni, 99.1% id,  0.0% wa,  0.1% hi,  0.2% si
Mem:   4024900k total,  3660740k used,   364160k free,    89172k buffers
Swap:  8385888k total,      208k used,  8385680k free,  2306264k cached

  PID USER      PR  NI %CPU    TIME+  %MEM  VIRT  RES  SHR S COMMAND
3094 www       15   0    0   0:00.72  0.9 50400  33m 1004 S nginx: worker process
3092 www       15   0    0   0:00.52  0.8 48352  31m  992 S nginx: worker process
3093 www       15   0    0   0:00.67  0.8 47328  30m  992 S nginx: worker process
3098 www       15   0    0   0:00.26  0.8 46304  29m  976 S nginx: worker process
3095 www       15   0    0   0:00.23  0.7 44256  27m  980 S nginx: worker process
3119 www       15   0    0   0:00.27  0.7 44256  27m  980 S nginx: worker process
3097 www       15   0    2   0:00.18  0.7 44256  27m  964 S nginx: worker process
3118 www       15   0    0   0:00.24  0.7 43232  27m  972 S nginx: worker process
3114 www       15   0    0   0:00.22  0.7 43232  27m  976 S nginx: worker process
3091 www       15   0    0   0:00.19  0.7 43232  26m  964 S nginx: worker process
3113 www       15   0    0   0:00.12  0.7 43232  26m  972 S nginx: worker process
3101 www       15   0    0   0:00.09  0.7 43232  25m  948 S nginx: worker process
3100 www       15   0    0   0:00.08  0.7 43232  25m  948 S nginx: worker process
3117 www       15   0    0   0:00.07  0.7 43232  25m  972 S nginx: worker process
3099 www       15   0    0   0:00.08  0.6 43232  25m  964 S nginx: worker process
3090 www       15   0    0   0:00.06  0.6 43232  25m  964 S nginx: worker process
3096 www       15   0    0   0:00.05  0.6 43232  25m  960 S nginx: worker process
3116 www       15   0    0   0:00.05  0.6 43232  24m  936 S nginx: worker process
3110 www       15   0    0   0:00.04  0.6 43232  24m  936 S nginx: worker process
3102 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3103 www       15   0    0   0:00.04  0.6 43232  24m  652 S nginx: worker process
3104 www       15   0    0   0:00.04  0.6 43232  24m  652 S nginx: worker process
3105 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3106 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3107 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3108 www       15   0    0   0:00.04  0.6 43232  24m  652 S nginx: worker process
3109 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3111 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3112 www       15   0    0   0:00.04  0.6 43232  24m  652 S nginx: worker process
3115 www       15   0    0   0:00.03  0.6 43232  24m  652 S nginx: worker process
3056 www       16   0    0   0:00.13  0.4  227m  15m  11m S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3074 www       15   0    0   0:00.12  0.3  227m  13m 9104 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3017 www       16   0    0   0:00.10  0.3  227m  12m 9032 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
2988 www       16   0    0   0:00.11  0.3  227m  12m 9108 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
2981 www       16   0    0   0:00.12  0.3  227m  12m 9044 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3036 www       16   0    0   0:00.11  0.3  227m  12m 8780 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3073 www       16   0    0   0:00.12  0.3  227m  12m 8968 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
2957 www       16   0    0   0:00.10  0.3  227m  12m 8716 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
2980 www       16   0    0   0:00.12  0.3  227m  12m 8608 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3046 www       16   0    0   0:00.10  0.3  227m  12m 8660 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3027 www       15   0    0   0:00.09  0.3  227m  12m 8840 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3023 www       16   0    0   0:00.10  0.3  227m  12m 8700 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3063 www       16   0    0   0:00.09  0.3  227m  12m 8472 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3009 www       16   0    0   0:00.10  0.3  227m  12m 8452 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
3016 www       16   0    0   0:00.15  0.3  227m  12m 8740 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
2956 www       16   0    0   0:00.10  0.3  227m  12m 8628 S /usr/local/php/bin/php-cgi --fpm --fpm-config /usr/local/php/etc/php-fpm.conf
没人遇到过这个问题吗?现在又出现这个问题了,每天早上都会有一个小时,这三天以来!
晕,我也遇到一样的问题,环境基本相同,也是Nginx + PHP FastCGI,这两天早上总有一段时间狂报499错误,用
netstat -anpo | grep "php-cgi" | wc -l

查看使用紧的进程数,居然比平常多出2~3倍,CPU几乎耗尽,也是大概1个小时后就变回正常,不知何因。。。
我的也是这个问题,当时看到网上有说是配置文件和启动文件不一致导致的,可没发现我的配置哪里有不一致的
如果前端没有问题,请详细分析一下后端是否有问题