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

clime picture clime · Feb 24, 2013 · Viewed 9.9k times · Source

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 ***

Answer

MrKsn picture MrKsn · Apr 7, 2013

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.