The game backend code is deployed in a nginx+php-fpm manner. Occasionally 502 errors occur when you ask the game.
Nginx error log appears in the following log
2014/07/05 17:20:58 [ERROR] 18431#0: *148739 recv () failed (104:connection reset by peer) while reading response header F Rom upstream, client:192.168.1.56, server:, Request: "Post/gateway.php http/1.1", Upstream: "fastcgi://127.0.0.1:9000" , Host: ""
Now list the troubleshooting ideas
Set the maximum time for PHP script execution in/etc/php.ini max_execution_time =30, here.
Set the PHP-FPM process to process time-out for each process in/etc/php-fpm.conf request_terminate_timeout = 30s
Turn on slow log of PHP in/etc/php-fpm.conf
request_slowlog_timeout = 1s
Slowlog =/var/log/php-fpm/www-slow.log
Set in Nginx configuration file nginx.conf
Fastcgi_connect_timeout 60; Set Nginx and fastcgi server to establish a connection time-out, default is 60 seconds, but this value can not often exceed 75 seconds
Fastcgi_send_timeout 60; To set the time-out for nginx transfer requests to fastcgi server
Fastcgi_read_timeout 60; To set the time-out for FASTCGI server read requests
This article is from the Linux SA John blog, so be sure to keep this source http://john88wang.blog.51cto.com/2165294/1435045