Hi,
On Mon, 23 Apr 2012 17:30:22 +0200
"Roberto De Ioris" <[email protected]> wrote:
> Hi Dave, i suggest you to look at the zerg mode (and in particular to
> the so called "zerg dance"). Check mailing-list posts of Marcin
> Deranek, as he helped a lot in improving the zerg system.
We do it in the following way (this is pretty much "zerg dance" as
described on the wiki):
* You need stats server and zerg server enabled (--zerg-fallback is not
needed when you initially start uwsgi or you don't plan to reload (HUP
signal) uwsgi):
${UWSGI} --stats "${statsfile}" --zerg-server "${zergfile}"
--zerg-fallback ...
Make sure you run at least 1.1.1 - previous versions might have
problems in certain areas.
* Rename sockets and pidfile
mv -f "${pidfile}" "${pidfile}.old"
mv -f "${zergfile}" "${zergfile}.old"
mv -f "${statsfile}" "${statsfile}.old"
* Start new instance with
${UWSGI} --stats "${statsfile}" --zerg-server "${zergfile}"
--zerg-fallback ...
* Pause old instance
${UWSGI} --pause "${pidfile}.old
* Wait till all requests have completed on old instance
eg.
nc -U "${statsfile}.old" | awk '/\"status\":/
&& ! /\"status\": \"(pause|cheap)\"/')"
* Stop old instance
${UWSGI} --stop "${pidfile}.old
..and you are done. This should be fully graceful restart which allows
you to upgrade all components of your web stack.
Cheers,
Marcin
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi