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?
It is a special uWSGI instance that will monitor specific events and will spawn/stop/reload instances (known as vassals, when managed by an Emperor) on demand. By default the Emperor will scan specific directories for supported (. ini, .
Nginx is “a web server which can also be used as a reverse proxy, load balancer, mail proxy and HTTP cache”. uWSGI is an implementation of the WSGI spec, which describes how a web server should communicate with a web app, which makes uWSGI also a type of web server.
WSGI is a specification. uWSGI provides an implementation of the WSGI specification. You can't compare them. You can only compare different implementations.
Gunicorn and uWSGI are primarily classified as "Web Servers" and "Web Server Interface" tools respectively. Gunicorn and uWSGI are both open source tools. Gunicorn with 5.96K GitHub stars and 1.12K forks on GitHub appears to be more popular than uWSGI with 2.5K GitHub stars and 541 GitHub forks.
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:
Cons
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With