Z
Z
z0rgoyok2015-07-02 18:16:16
PHP
z0rgoyok, 2015-07-02 18:16:16

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

2 answer(s)
M
matperez, 2015-07-02
@matperez

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.

N
NaN, 2015-07-02
@NaN

20-30 seconds?

very similar to the session re-creation problem :
search:
Prevent scripts from hanging due to session file lock

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question