Restarting nginx backends without losing requests

Posted by Oli on Server Fault See other posts from Server Fault or by Oli
Published on 2012-12-18T17:02:27Z Indexed on 2012/12/18 17:04 UTC
Read the original article Hit count: 149

Filed under:
|

I'm sure it's been asked before in different words but I run several Django sites via uwsgi (emporer mode) behind nginx. It's all a fairly standard configuration but I find that if I restart the central uwsgi process, nginx just bombs out 502s rather than waiting for the socket to become available.

I recognise that most of this is probably for a reason but people seeing 502 errors really stings me. It's certainly not something I want a client to see. So...

  • Can I beg nginx to wait/retry backends? Or,
  • Is there anything (other than the obvious) I can do to minimise commercial damage from uwsgi restarts?

© Server Fault or respective owner

Related posts about nginx

Related posts about uwsgi