Services frequently reach 499 (Nginx + PHP-fpm). from which aspects should this problem be traced? Services frequently reach 499 (Nginx + PHP-fpm). from which aspects should this problem be traced?
Reply content:
Services frequently reach 499 (Nginx + PHP-fpm). from which aspects should this problem be traced?
499The client closed the connection.
Generally, the client closes the connection because it has been waiting for too long. Therefore, it is recommended that you check whether the processing capability of the PHP processing program is sufficient to meet your needs, increase the processing process appropriately, and reduce the waiting time of the client. In addition, it is bestnginxConfiguration inproxy_ignore_client_abort on;To ignore client disconnection requests to avoid exceptions caused by program interruption.
Of course, there may be attacks...
1. the client's request speed is slow. check whether the request speed is really slow through the sample.
2. the machine bandwidth is full and the request is slow.
3. check the nginx timeout time and adjust the time to a longer value. The default value is 60 s.
client_header_timeout 180s;client_body_timeout 180s;
499 corresponds to "client has closed connection ". This is probably because the processing time on the server side is too long and the client is "impatient. To solve this problem, you need to optimize the program. (Similar to 50 * errors)
Rfc2616, 400 ~ The error codes of the 500 error codes are only defined as 417, so 499 should be defined by nginx.
From http://blog.csdn.net/rainday0310/article/details/8166163
1. 499. the client has closed connection indicates that the client actively disconnects the connection. generally, it takes too long for the server to process the connection. if the client cannot wait, it will be disconnected. Another scenario is that an attack deliberately consumes server resources so that the server cannot process the request in time and return the result.
2. Solution: optimize the number of php processes, fastcgi execution timeout, and http forwarding configuration errors to prevent the server from processing http requests for too long.