Warning for "PHP FPM max listen queue"

Hello.

I noticed that in recent versions of Shopware 6, I get a warning for “PHP FPM max listen queue” being over zero. This is shown by the Tools extension.

I think I managed to fix it by adding listen.backlog = 0 to one of my configs in php-fpm.d.

Is there any reason as to why is this supposed to be set to zero? Won’t that limit performance? The linked info page does not provide any useful information as to how this affects Shopware nor why the recommended value is the recommended value. Also, is my solution correct?

Why would you set this to 0? That means that there will be no queue, the user will get immediately a 500 error.

Exactly.

Then does any value above 0 trigger a warning? Why is 0 “recommended?”

The recommendation means that the max-children-reached counter should ideally never increase, i.e., it should remain at 0.

It does not mean that you should set listen.backlog = 0.

This counter is incremented whenever all available PHP-FPM child processes are busy and a new request cannot be served immediately. Once incremented, it will keep its value until PHP-FPM is restarted. Therefore, the counter only tells you that the max-children-reached limit has been hit at least once since PHP-FPM started, but it does not show how often it happened over time.

Thank you.

Could this be caused by pm.max_children being too low? It’s currently set to 16.

Shouldn’t this trigger PHP FPM max children reached as well?

Yes, this is why the max-children-reached counter has increased to 1.

However, this does not necessarily mean that increasing the value of pm.max_children will solve the problem. The available RAM is shared among all PHP-FPM child processes. If you allow too many children, you risk running into “out of memory” issues.

My recommendation: do not change settings solely because they are recommended by a guide or tool. First, make sure you understand how the new values work and whether they could have negative consequences for your specific hosting environment.

1 „Gefällt mir“