T
T
topuserman2021-11-14 14:07:34
PHP
topuserman, 2021-11-14 14:07:34

Nginx + php-fpm: where does the queue for processes accumulate and can this queue be monitored?

I'm doing load testing of nginx + php-fpm configuration.
The question arose:

For example, 1,000 requests arrive in nginx at the same time.
Let php-fpm be able to process 100 requests at the same time.

What happens to the other 900 requests while php-fpm processes the first batch?
That is, where exactly is the queue accumulating? Does Nginx proxy the entire incoming batch of requests to php-fpm at once? Or it keeps a queue and waits for managers to be released to process requests from the queue.

And the second question: where and how can you observe this queue? Through htop is not visible for obvious reasons))

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Karabanov, 2021-11-14
@karabanov

Nginx has native monitoring NGINX Monitoring , in particular, you can see the number of active and pending connections.

K
ky0, 2021-11-14
@ky0

With the remaining 900 requests, most likely, a 504 will occur. To spread the load, you can use the limit_req nginx module .

S
shiza88, 2021-11-18
@shiza88

Connect some kind of queue server, similar to the same beansolk and shove it with a worker and monitor the work process

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question