Skip to content

Commit

Permalink
add a caution block about php-fpm pool
Browse files Browse the repository at this point in the history
  • Loading branch information
tristanbes committed Dec 16, 2016
1 parent 020f1b7 commit cdf248c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions components/process.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,14 @@ are done doing other stuff::
advantage of the ``kernel.terminate`` event, and run your command **synchronuously**
inside this event. Be aware that ``kernel.terminate`` is called only if you run ``PHP-FPM``.

.. caution::

Beware also that if you do that, the said php process won't available to serve
any new request until the subprocess is finished, which means you can block your
FPM pool quickly if you're not careful enough.
That's why it generally way better to not do any fancy thing even after the request is sent
but prefer using a job queue.

:method:`Symfony\\Component\\Process\\Process::wait` takes one optional argument:
a callback that is called repeatedly whilst the process is still running, passing
in the output and its type::
Expand Down

0 comments on commit cdf248c

Please sign in to comment.