0

I would like to limit PHP-FPM to execute only once at a given time, which means any further request will be queued.

I'm using nginx but I think it's a matter of PHP-FPM configuration.

I read about PHP-FPM listen.backlog and process.max, it looked for me that process.max is what I need to tune but I wasn't sure..

What is the right way to achieve this?

iTaMaR
  • 189
  • 2
  • 10

1 Answers1

1

You're right. Just set these parameters:

pm = static
pm.max_children = 1

But maybe you need a locking mechanism? In this case you can try using some of this:

https://www.php.net/manual/en/function.sem-acquire.php

https://symfony.com/doc/current/lock.html

abler98
  • 458
  • 1
  • 6
  • 12