Enqueue incoming connections while PHP restarts

Jean-Baptiste Quenot jbq at caraldi.com
Sun Dec 6 23:02:38 MSK 2009

2009/12/6 Steffen Weber <steffen.weber at gmail.com>:
> it is currently possible to restart nginx without losing any incoming
> connections. See
> http://wiki.nginx.org/NginxCommandLine#Upgrading_To_a_New_Binary_On_The_Fly
> But what if I have to restart PHP? Is it possible to let nginx enqueue
> incoming connections while PHP is restarting?


At my site I do this with two servers, A and B load-balanced with
haproxy:.  Under normal conditions, traffic is served both on A and B.
 Then when it's time to restart your app, this is what I do:

1) soft-stop nginx on A, current requests will be properly honored,
and haproxy will route new requests to B
2) restart your app
3) start nginx, haproxy will route traffic back to both A and B

Once this process is applied on A, do the same on B, in sequence.
Jean-Baptiste Quenot

More information about the nginx mailing list