Nginx under PHP frequently stuck dead 502

Source: Internet
Author: User

Resolution: [WARNING] Fpm_children_bury (), line 215:child 2736 (pool default) exited on signal SIGTERM after 59.588363 seconds From startposted by  break ice  on 2013-6-7 23:59 Friday trial Nginx + PHP FastCGI do Web server, run for a few months, the trouble is often encountered Nginx 502 bad Gat eWAY the problem. Refer to a lot of changes, this 502 problem has been existing, today intends to reload PHP fastcgi to the installation directory of PHP, found that PHP log file has dozens of m size, open a look, the results are basically all the error:  jan 11 08:54:01.164292 [NOTICE] Fpm_children_make (), line 352:child 10088 (pool default) Startedjan 08:54:01.164325 [WARNING] Fpm_children_bury (), line 215:child 7985 (pool default) exited on signal SIGTERM after 63.778601 seconds from Startja n one 08:54:01.165485 [NOTICE] Fpm_children_make (), line 352:child 10089 (pool default) Startedjan one 08:54:01.165514 [WAR NING] Fpm_children_bury (), line 215:child 7999 (pool default) exited on signal SIGTERM after 60.297326 seconds from St Artjan 08:54:01.166696 [NOTICE] Fpm_children_make (), line 352:child 10090 (pool default) Startedjan 11 08:54:01.166727 [WARNING] Fpm_children_bury (), Line 215:child 8000 (pool default) exited on signal SIGTERM after 60.296946 seconds from Startjan 11 08:54:01.167855 [NOTICE] Fpm_children_make (), line 352:child 10091 (pool default) Startedjan 04:00:50.443884 [NOTICE] Fpm_children_mak E (), line 352:child 10127 (pool default) Startedjan 04:00:50.443917 [NOTICE] Fpm_event_loop (), line 107:libevent:ent ering main Loopjan 12:05:08.425141 [WARNING] fpm_request_check_timed_out (), line 158:child 10120, script '/home/htdocs /www/index.php ' (pool default) execution timed out (30.051306 sec), terminating   checked resources online, The basic is that the PHP thread opens a file handle that is limited by the error. The specific solution is as follows:  1. Raise the file handle of the server open open/etc/security/limits.conf: (Increased) * Soft nofile 51200* hard nofile 51200# vi/etc/security/limits.conf Plus
* Soft Nofile 51200
* Hard Nofile 51200 2, increase the number of open Nginx process fileNginx.conf:worker_rlimit_nofile 51200; 3, modify the php-fpm.conf file, the main need to modify 2。  Command Ulimit-n View the number of open files that are restricted, and the options in php-fpm.conf rlimit_files ensure that they are consistent with this value. <value name= "max_requests" >10240</value> <value name= "Rlimit_files" >51200</value> 4, # VI/ Etc/sysctl.conf
Bottom add
fs.file-max=51200

Complete the above changes, restart PHP, the warning message no longer. The world is quiet, 502 bad Gateway.

Nginx under PHP frequently stuck dead 502

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.