CentOS System nginx+php5.5 PHP-FPM Common 502 Bad Gateway solution technique

Source: Internet
Author: User
Tags fpm log log

Server normal operation 2 months, the day before yesterday the whole station suddenly appeared 502 bad Gateway, all pages are not open, using the NGINX+PHP-FPM mode.
Server situation: This server traffic is relatively large, PV around 300,000 per day, database use of MYSQL5, the largest table data has 800,000, the total database capacity of about 10G.
The failure occurred immediately after the thought may be php-fpm hang off. PS to see the PHP-FPM process, and then look at the port also has 9000 run, indicating that the PHP-FPM is operating normally. Why does it still appear 502. Restart the nginx problem still, and then restart the PHP-FPM problem is still unresolved.
is eagerly looking for the source of the problem, suddenly the server is not connected, one asked the original other colleagues did not know how to restart the server. And so the server restarted again normal, too strange problem.


Nginx collocation of the php-fpm suddenly stopped responding to the initial finding.

A few days ago found a server PHP-FPM suddenly aborted the response, and restart PHP-FPM still invalid.
Symptoms:
1. Nginx running normally, MySQL running normally. Static HTML files can be accessed normally. Stating that Nginx service is not a problem
2. Only PHP pages are not open. Error 502 Bad Getway, indicating that there is a problem between Nginx and PHP-FPM.
3. Nginx's 80 port, PHP-FPM 9000 ports are running. The PHP page still doesn't respond.
4. Restarting the PHP-FPM process is still a problem. Finally reboot the server to recover, the problem is more serious.

View the core time log file as follows:
[01-apr-2014 17:38:13] WARNING: [Pool www] child 31153, script '/data/web/php/api/work.php ' (Request: "get/api/work.php") execution timed out (5 5.098115 sec), terminating
[01-apr-2014 17:38:13] WARNING: [Pool www] child 31153 exited on signal (sigterm) after 112950.411997 seconds from start
[01-apr-2014 17:38:13] NOTICE: [Pool www] child 1436 started
[01-apr-2014 17:38:21] WARNING: [Pool www] child 29802, script '/data/web/php/api/work.php ' (Request: "get/api/work.php") executing too (3. 019993 sec), logging
[01-apr-2014 17:38:21] Notice:child 29802 stopped for tracing
[01-apr-2014 17:38:21] Notice:about to trace 29802
[01-apr-2014 17:38:21] Error:failed to Ptrace (peekdata) PID 29802:input/output error (5)
[01-apr-2014 17:38:21] notice:finished Trace of 29802
[01-apr-2014 17:38:59] WARNING: [Pool www] child 28407, script '/data/web/php/api/work.php ' (Request: "get/api/work.php") execution timed out (5 5.150273 sec), terminating
[01-apr-2014 17:38:59] WARNING: [Pool www] child 28407 exited on signal (sigterm) after 8480.945886 seconds from start
You can see that some processes take a long time to occupy. More than 55 seconds. Then there is the PHP-FPM stop response.

The preliminary judgment should be the program unreasonable cause the script long time execution causes the server resources to crash, finally causes the PHP-FPM to appear the unrecoverable exception. I don't know if it's a php-fpm bug.
PHP version is: PHP versions 5.4.23, using the Php-fpm+nginx mode, using 9000-port and Nginx for communication.


PHP-FPM suddenly unable to respond and error error:failed to Ptrace (peekdata) PID 3854:input/output error

NGINX+PHP-FPM (PHP version is 5.4), PHP-FPM after running for a while suddenly stop responding, restart Nginx and PHP-FPM are invalid. You can only reboot the server to view the log log logs of PHP-FPM, many similar to the error:failed to Ptrace (peekdata) PID 23199:input/output error (5).
[03-apr-2014 13:40:24] Error:failed to Ptrace (peekdata) PID 23199:input/output error (5)
[03-apr-2014 13:40:24] notice:finished Trace of 23199
[03-apr-2014 13:40:44] WARNING: [Pool www] child 3854, script '/var/www/www.111cn.net ' (Request: "post/getacd.php") executing too (3.618411 SEC), logging
[03-apr-2014 13:40:44] Notice:child 3854 stopped for tracing
[03-apr-2014 13:40:44] Notice:about to trace 3854
[03-apr-2014 13:40:44] Error:failed to Ptrace (peekdata) PID 3854:input/output error (5)
[03-apr-2014 13:40:44] notice:finished Trace of 3854
[03-apr-2014 13:40:56] WARNING: [Pool www] child 23375, script '/var/www/www.111cn.net ' (Request: "post/getacd.php") executing too (3.63916 0 sec), logging
[03-apr-2014 13:40:56] Notice:child 23375 stopped for tracing
[03-apr-2014 13:40:56] Notice:about to trace 23375
[03-apr-2014 13:40:56] notice:finished Trace of 23375
[03-apr-2014 13:41:16] WARNING: [Pool www] child 23199, script '/var/dweb/web5/api/acdsvr.php ' (Request: "get/api/acdsvr.php") execution timed O UT (55.197093 sec), terminating
[03-apr-2014 13:41:16] WARNING: [Pool www] child 23199 exited on signal (sigterm) after 67025.486593 seconds from start
[03-apr-2014 13:41:16] NOTICE: [Pool www] child 29676 started
[03-apr-2014 13:43:01] WARNING: [Pool www] child 13723, script '/var/www/www.111cn.net ' (Request: "post/getacd.php") executing too (3.70775 7 sec), logging
[03-apr-2014 13:43:01] Notice:child 13723 stopped for tracing
[03-apr-2014 13:43:01] Notice:about to Trace 13723
[03-apr-2014 13:43:01] Error:failed to Ptrace (peekdata) PID 13723:input/output error (5)
[03-apr-2014 13:43:01] notice:finished Trace of 13723
[03-apr-2014 13:44:01] WARNING: [Pool www] child 28475, script '/var/www/www.111cn.net ' (Request: "post/getacd.php") executing too (3.13460 0 sec), logging
[03-apr-2014 13:44:01] Notice:child 28475 stopped for tracing
[03-apr-2014 13:44:01] Notice:about to trace 28475
[03-apr-2014 13:44:01] Error:failed to Ptrace (peekdata) PID 28475:input/output error (5)

The problem is being tracked!

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.