The php-fpm man page states the response to a USR2 signal is: "graceful reload of all workers + reload of fpm conf/binary". However, in testing I find that a reload actually kills workers processing requests. I was expecting requests to be allowed to finish before the processes were killed and re-spawned.
Is this broken, my expectation wrong, or test invalid?
My test setup:
Ubuntu 16.04 LXC container
install php7.0-fpm and nginx
php script to sleep and output countdown each second
send request to sleep for 30 seconds via curl
issue reload via systemctl
Test result:
request was killed immedietly upon reload
process_control_timeout=5it kills the connection immediately. – Marki555 Jan 08 '20 at 15:315sinstead of5even the config file says the seconds are default unit for this option. – Marki555 Jan 08 '20 at 15:39- PHP-FPM will not serve new requests until the reload finishes completely. All these new requests will, however, be queued by the fpm and executed immediately after the reload is complete. The result to the end user is that they see a browser loading spinner during that time.
- PHP-FPM will interrupt
- Above points were tested on php-fpm 5.5. Likely same on 7.x.
– d-ph Jul 03 '20 at 17:18sleep()ing scripts as if thesleep()timeout was reached, making those scripts continue running. Potential issue if exact sleep() periods are relied upon.