Our server was down for serving http requests for some minutes. The web server is nginx and php-fpm handles the php processes. So in the middle of downtime duration I took a look at nginx's access.log
file. Most of requests were getting a 499 response code which is nginx particular status code for when client closes the connection before the server answers.
I restarted nginx sudo nginx -s reload
but that didn't seem to effect the behavior. I then restarted php-fpm
service and everything came back normal. Before issuing service restart, htop
was showing no high CPU usage.
My question is how can I find the reason in such situations and where should I start from to get to the bottleneck?
your server was down
did you mean baremetal, or whole service (nginx+php-fpm)? Are you looking for the reason of failing to serve http requests, or the reason of those amount of 499?