Я перешел на php5-fpm при установке nginx ~ 2 месяца назад. Все было хорошо до тех пор, пока несколько дней назад я не заметил, что мои веб-сайты php не отвечают (браузер просто ждал данных и, в конечном итоге, превышал время ожидания). Помог перезапуск php5-fpm. Вот конец моего /var/log/php5-fpm.log:
[09-Feb-2013 07:22:46] NOTICE: [pool www] child 26802 started
[09-Feb-2013 20:09:07] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[10-Feb-2013 07:22:40] WARNING: [pool www] child 5986 exited on signal 11 (SIGSEGV - core dumped) after 40414.794799 seconds from start
[10-Feb-2013 07:22:40] NOTICE: [pool www] child 13596 started
[11-Feb-2013 07:22:14] WARNING: [pool www] child 23530 exited on signal 11 (SIGSEGV - core dumped) after 36419.156740 seconds from start
[11-Feb-2013 07:22:14] NOTICE: [pool www] child 31088 started
[12-Feb-2013 06:25:07 [09-Feb-2013 20:09:07] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[10-Feb-2013 07:22:40] WARNING: [pool www] child 5986 exited on signal 11 (SIGSEGV - core dumped) after 40414.794799 seconds from start
[10-Feb-2013 07:22:40] NOTICE: [pool www] child 13596 started
[11-Feb-2013 07:22:14] WARNING: [pool www] child 23530 exited on signal 11 (SIGSEGV - core dumped) after 36419.156740 seconds from start
[11-Feb-2013 07:22:14] NOTICE: [pool www] child 31088 started
[12-Feb-2013 06:25:07] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[12-Feb-2013 07:22:34] WARNING: [pool www] child 20736 exited on signal 11 (SIGSEGV - core dumped) after 3448.720422 seconds from start
[12-Feb-2013 07:22:34] NOTICE: [pool www] child 23808 started
[13-Feb-2013 06:57:30] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-Feb-2013 07:21:48] WARNING: [pool www] child 13307 exited on signal 11 (SIGSEGV - core dumped) after 1459.134695 seconds from start
[13-Feb-2013 07:21:48] NOTICE: [pool www] child 13596 started
[13-Feb-2013 08:18:13] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-Feb-2013 11:14:49] NOTICE: Finishing ...
[13-Feb-2013 11:14:49] NOTICE: exiting, bye-bye!
[13-Feb-2013 11:14:50] NOTICE: fpm is running, pid 16123
[13-Feb-2013 11:14:50] NOTICE: ready to handle connections
[13-Feb-2013 15:21:53] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[14-Feb-2013 07:22:23] WARNING: [pool www] child 27208 exited on signal 11 (SIGSEGV - core dumped) after 17743.276891 seconds from start
[14-Feb-2013 07:22:23] NOTICE: [pool www] child 31521 started
[14-Feb-2013 15:21:33] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[15-Feb-2013 07:21:51] WARNING: [pool www] child 9699 exited on signal 11 (SIGSEGV - core dumped) after 36679.697975 seconds from start
[15-Feb-2013 07:21:51] NOTICE: [pool www] child 16671 started
[15-Feb-2013 09:35:35] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[16-Feb-2013 07:22:18] WARNING: [pool www] child 29553 exited on signal 11 (SIGSEGV - core dumped) after 22986.940724 seconds from start
[16-Feb-2013 07:22:18] NOTICE: [pool www] child 1459 started
[17-Feb-2013 07:21:42] WARNING: [pool www] child 10229 exited on signal 11 (SIGSEGV - core dumped) after 45737.338223 seconds from start
[17-Feb-2013 07:21:42] NOTICE: [pool www] child 18539 started
[17-Feb-2013 08:19:01] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[17-Feb-2013 22:27:30] NOTICE: Finishing ...
[17-Feb-2013 22:27:31] NOTICE: exiting, bye-bye!
[17-Feb-2013 22:27:31] NOTICE: fpm is running, pid 24139
[17-Feb-2013 22:27:31] NOTICE: ready to handle connections] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[12-Feb-2013 07:22:34] WARNING: [pool www] child 20736 exited on signal 11 (SIGSEGV - core dumped) after 3448.720422 seconds from start
[12-Feb-2013 07:22:34] NOTICE: [pool www] child 23808 started
[13-Feb-2013 06:57:30] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-Feb-2013 07:21:48] WARNING: [pool www] child 13307 exited on signal 11 (SIGSEGV - core dumped) after 1459.134695 seconds from start
[13-Feb-2013 07:21:48] NOTICE: [pool www] child 13596 started
[13-Feb-2013 08:18:13] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[13-Feb-2013 11:14:49] NOTICE: Finishing ...
[13-Feb-2013 11:14:49] NOTICE: exiting, bye-bye!
[13-Feb-2013 11:14:50] NOTICE: fpm is running, pid 16123
[13-Feb-2013 11:14:50] NOTICE: ready to handle connections
[13-Feb-2013 15:21:53] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[14-Feb-2013 07:22:23] WARNING: [pool www] child 27208 exited on signal 11 (SIGSEGV - core dumped) after 17743.276891 seconds from start
[14-Feb-2013 07:22:23] NOTICE: [pool www] child 31521 started
[14-Feb-2013 15:21:33] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[15-Feb-2013 07:21:51] WARNING: [pool www] child 9699 exited on signal 11 (SIGSEGV - core dumped) after 36679.697975 seconds from start
[15-Feb-2013 07:21:51] NOTICE: [pool www] child 16671 started
[15-Feb-2013 09:35:35] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[16-Feb-2013 07:22:18] WARNING: [pool www] child 29553 exited on signal 11 (SIGSEGV - core dumped) after 22986.940724 seconds from start
[16-Feb-2013 07:22:18] NOTICE: [pool www] child 1459 started
[17-Feb-2013 07:21:42] WARNING: [pool www] child 10229 exited on signal 11 (SIGSEGV - core dumped) after 45737.338223 seconds from start
[17-Feb-2013 07:21:42] NOTICE: [pool www] child 18539 started
[17-Feb-2013 08:19:01] WARNING: [pool www] server reached pm.max_children setting (10), consider raising it
[17-Feb-2013 22:27:30] NOTICE: Finishing ...
[17-Feb-2013 22:27:31] NOTICE: exiting, bye-bye!
[17-Feb-2013 22:27:31] NOTICE: fpm is running, pid 24139
[17-Feb-2013 22:27:31] NOTICE: ready to handle connections
Строки «Finishing ...» - это когда я перезапускал службу php5-fpm вручную. Я знаю, что это не так много информации. Подскажите пожалуйста, что еще нужно.
В чем может быть проблема?
В этом журнале показаны две отдельные и разные проблемы.
pm.max_children
установлен слишком низко. Это контролирует, сколько процессов PHP будет порождено для обработки одновременных входящих запросов. Если поступает больше запросов, чем доступно потомков, новые соединения должны ждать ... в конце концов, они будут ждать вечно. Увеличьте это значение; найди это в /etc/php-fpm.d/www.conf
.
Это настоящая причина вашей непосредственной проблемы, хотя у вас есть более коварные проблемы, которые вы, вероятно, еще не заметили ...
child ... exited on signal 11
означает, что PHP дает сбой при обслуживании запросов. В зависимости от когда во время обработки произошел сбой, это может не иметь видимого влияния или может привести к пустым страницам, прерванным передачам, таинственным выходам пользователей из системы и т. д. Рассмотрите возможность обновления PHP до последней версии (5.3.x или 5.4.x) и удаления или замена известных проблемных расширений, таких как APC.