Answer the question
In order to leave comments, you need to log in
Long server response, 504 error where to dig?
Greetings comrades, I have such a didikate machine: debian 8.5 + nginx + php7.0-fpm + mysql + me (not an admin, a simple developer with little knowledge of unix)
I wake up in the morning and look at the kraaaaine long responses from the server and sometimes gives a 504 error. We go to the server and look, there is no top / htop load at all, or it is minimal up to 10% (there are a lot of processors and operatives), well, I think, we reboot nginx, mysql - the result is zero, how the server was stupid and stupid.
It didn't happen before, I can't imagine where to dig... Nothing of the kind was released highly loaded, the logs are normal...
Can there be problems with the DNS or the hoster? Or 100% look for a trouble?
Answer the question
In order to leave comments, you need to log in
If you have third-party services from PHP twitching, I would first of all look there. Probably something fell off. The symptoms seem to be.
If I'm right, then:
- set timeouts for making requests to third-party APIs. CURL_TIMEOUT, CURL_CONNECTTIMEOUT (both must be set), or default_socket_timeout, depending on how the request is made.
- cache the results of calls to third-party services (even if an error is returned, you should cache the response and not break into a dead service for a while)
- if possible, make calls to third-party services on the broad shoulders of CRON.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question