Enqueue incoming connections while PHP restarts
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
> 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.
More information about the nginx