Answer the question
In order to leave comments, you need to log in
Nginx + php-fpm sometimes takes a long time to respond, why?
The situation is as follows, there is a web service, json is constantly loaded by Ajax. There are mobile clients that also request data, there is an order that is created by an http request. Sometimes the following problem arises:
an order is created from the web service, the mobile client sees it immediately (they ask once a second), and the server responds to the page in 20-30 seconds. That is, the order has been created, but the response is delayed, although the mobile client, having requested from the server, sees it immediately, that is, it has been created. This does not always happen, but often, very often. But customers consistently see the order immediately.
Answer the question
In order to leave comments, you need to log in
Try profiling the request through some xhprof. If you have a high load on the service, you can run a profiler for every 10 requests, for example. When you're done, the profile will show exactly where the delay occurs. There are a lot of articles with examples of use. Here is one. If anything, XDebug also knows how to profile.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question