Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

uWSGI: --master with --emperor spawns two emperors

Tags:

uwsgi

I can see that if I start uwsgi like this:

sudo /usr/local/bin/uwsgi --emperor /etc/uwsgi/vassals --uid www --gid www 

it creates one emperor copy. But if I start it with --master additionally (as recommended here), it creates two emperor copies. Does it make sense to use --master with --emperor? I would say no, but if I run it without that option I get this warning:

*** WARNING: you are running uWSGI without its master process manager ***

like image 488
clime Avatar asked Feb 24 '13 18:02

clime


2 Answers

Here is what official documentation says:

The emperor should generally not be run with --master, unless master features like advanced logging are specifically needed.

If you're wondering what master option does, here is the answer:

master

uWSGI’s built-in prefork+threading multi-worker management mode, activated by flicking the master switch on. For all practical serving deployments it’s not really a good idea not to use master mode.

So, to summarize:

  • Use --master for usual uWSGI instance,
  • Do not use --master for uWSGI Emperor.
like image 194
MrKsn Avatar answered Oct 12 '22 10:10

MrKsn


I disagree - the documentation says it is not a good idea NOT to use it, in production anyway; I guess the double negative could be written more clearly.

Therefore it would appear it IS a good idea to use it, hence the warning.

like image 35
Tom T. Avatar answered Oct 12 '22 12:10

Tom T.