hello:
recently I try to use uwsgi zerg mode to deploy my project with real
zero-downtime reload, but it was not progressing smoothly
(1)
firstly with no emperor, start the main instance with zerg-server,
and then attach a zerg instance, random pause any instance, another instance
can work
well
main instance config
[uwsgi]
socket = 127.0.0.1:9998
master = true
processes = 1
gevent = 100
enable-threads = true
lazy-apps = true
zerg-server = /tmp/zergtest
wsgi-file = app.py
zerg instance config
[uwsgi]
master = true
processes = 1
gevent = 100
enable-threads = true
lazy-apps = true
zerg = /tmp/zergtest
wsgi-file = app.py
I list all options which may effect the uwsgi action, for example gevent
& lazy-apps. zerg-server is ok, but change it to zergpool, project can not
work. when I pause the main instance, request was also be suspended until I
resume the main instance, but as I expected, zerg instance should handle the
request. so which mistake I made ? zerg-server do not equal to zergpool ?
(2) I ignore the zergpool problem and try to use zerg-server to finish
zero-downtime reload.
main instance config
zerg-server = /tmp/zergtest
wsgi-file = app.py
master-fifo = /tmp/new.fifo
master-fifo = /tmp/running.fifo
hook-accepting1-once = writefifo:/tmp/new.fifo 1
and zerg instance config
master-fifo = /tmp/new.fifo
master-fifo = /tmp/running.fifo
if-exists = /tmp/running.fifo
hook-accepting1-once = writefifo:/tmp/running.fifo q
endif =
hook-accepting1-once = writefifo:/tmp/new.fifo 1
my purpose is simple. when I reload project, spawn a zerg instance and
graceful shutdown the first instance. all reload repeat this procedure. but
zerg-server also shutdown obviously.
I try to start a pure zerg-server without any app load, and attach
zerg-instance to it. when I reload, use a new zerg-instance and shutdown an
old zerg-instance. but uwsgi report no app load error when handle request.
main instance still spawn a worker and handle request.
Maybe I can pause the main instance worker, and attach zerg-instance
continuous, one zerg replace another, but I suspect it is the best solution.
so
any best practice for zerg zero-downtime reload ?
In doc
https://uwsgi-docs.readthedocs.org/en/latest/articles/TheArtOfGracefulReloading.html,
exists the same problem I think. If I shutdown the sleeping instance (
hook-accepting1-once = writefifo:/var/run/sleeping.fifo Q), the instance with
zerg server will quit. BTW, I want only one instance exists at the same time.
(3)
If use emperor to manage instance, if I spawn a zerg instance and
graceful shutdown the current instance, emperor always try to respawn the main
instance, although the zerg instance indeed exists. so how to use emperor to
finish zero-downtime reload with zerg mode ?
best regargs
_______________________________________________
uWSGI mailing list
[email protected]
http://lists.unbit.it/cgi-bin/mailman/listinfo/uwsgi