nginx+uWSGI: dynamic vs emperor mode
nginx, uwsgi
Solution
Emperor mode is for handling multi-application environments. It basically monitors the directories you specify for new apps & events you want it to respond to.
Pros:
- You can gracefully reload a site when you update your code by touching the vassal file.
- Apps respawn on crashes & reboots.
- Scales very nice if you need to add multiple servers
- Throttles your vassals to prevent Denial of Service (DoS)
Cons
- I'm not sure there are any. I believe this is the preferred way to run apps (even if only one).
I'm not 100% certain, but I believe launching with the settings provided in the docs will only launch an app Nginx passes. There are two issues I see with this, you're stuck with Nginx. Not saying that's bad, but if you wanted to play around with, or decided to move to another server, you might need to redo the setup. Also, this does not provide any of the benefits I mentioned earlier.
Problem
I am doing multi-application nginx+uWSGI setup and I wonder if I should use dynamic mode of uWSGI as documented here (under Dynamic apps) or the Emperor mode. I am slightly more inclined to use the emperor mode but maybe it is not the best choice. What are pros/cons of each?