hello:
I scan maillist for zerg mode, maybe I shoud use zergpool instead of
zerg server, and attach zerg intance continuously. But I try many times for
different options, zergpool can't work for me
a simple config test.ini for zergpool
[uwsgi]
master = true
zergpool = /tmp/zergpool_1:127.0.0.1:3031,127.0.0.1:3032
and run this instance by
uwsgi --ini ./zerg_test.ini --http :9090 --wsgi-file ./myapp.py (master pid
1111)
and then attach zerg instance to zergpool
uwsgi --zerg /tmp/zergpool_1 --wsgi-file ./myapp.py --master --processes 1
(master pid 1112)
If I send a SIGTSTP signal to pause master 1111, the request (curl -s -v
"http://localhost:9090") will be suspended, obviously attached zerg instance
can't work.
Maybe I shoud start a zergpool instance without app load ? If I run instance by
uwsgi --ini ./zerg_test.ini --http :9090 (without wsgi-file)
and then attach zerg instance, uwsgi report no app load.
so how to use zergpool ? any mistake I has made?
At 2016-02-02 11:06:36, "xin" <[email protected]> wrote:
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