unbit / uwsgi

uWSGI application server container
http://projects.unbit.it/uwsgi
Other
3.45k stars 691 forks source link

emperor-on-demand-exec stops listening to socket when idle workers die #608

Closed manelclos closed 10 years ago

manelclos commented 10 years ago

Hi,

I'm currently running emperor mode successfully:

emperor /apps/*/uwsgi.ini -> every app has a master process running

when trying to switch to on-demand-exec it works, the emperor listens to the socket, the master process is launched, and a worker too. Once the worker is killed due to idle time, I can no longer access the app (nginx will return gateway timeout).

unbit commented 10 years ago

Be sure your vassal file does not define a "socket" directive, when used with unix sockets it causes problems as uWSGI will bind on two addresses (the second unlinking the first one bound by the Emperor). If it is the case you should see each vassal binding two times. If you are using TCP sockets or you do not have a socket directive paste the script you use to bind.

manelclos commented 10 years ago

That was it!

Normal emperor mode: Wed Apr 30 08:34:45 2014 - uwsgi socket 0 bound to UNIX address /apps/app1//uwsgi.sock fd 3

Activating on-demand-exec: Wed Apr 30 08:33:54 2014 - uwsgi socket 0 bound to UNIX address /apps/app1//uwsgi.sock fd 3 Wed Apr 30 08:33:54 2014 - uwsgi socket 1 inherited UNIX address /apps/app1/uwsgi.sock fd 0

On-demand-exec, comenting "socket" option in vassal configuration: Wed Apr 30 08:37:12 2014 - uwsgi socket 0 inherited UNIX address /apps/app1/uwsgi.sock fd 0

Thanks!