Nginx + uWSGI: dynamic versus emperor mode

I am configuring nginx + uWSGI with multiple applications, and I am wondering if I should use uWSGI dynamic mode as described here (in dynamic applications) or Imperial mode . I'm a little inclined to use emperor mode, but maybe this is not the best choice. What are the pros and cons of each?

+4
source share
2 answers

Emperor mode is designed to handle environments with multiple applications. It basically controls the directories that you specify for new applications and events that you want to respond to.

Pros:

  • You can gracefully reload the site when you update your code by touching a vassal file.
  • Services are returned upon crashes and reboots.
  • The scales are very nice if you need to add multiple servers.
  • Throttles your vassals to prevent denial of service (DoS).

vs

  • I'm not sure what they are. I believe this is the preferred way to run applications (even if one).

I am not 100% sure, but I believe that starting with the settings presented in the documents will only launch Nginx applications. There are two questions that I see with this, you are stuck with Nginx. Not to say that it’s bad, but if you want to play or decide to switch to another server, you may need to repeat the configuration. In addition, it does not provide any of the benefits that I mentioned earlier.

+8
source

Dynamic mode is only for people arriving with mod_python, mod_perl or mod_wsgi in non-daemon mode, who want / need a similar setup. For all other uses (I would say 99.9% use), the Emperor is the best choice. Keep in mind that only plugins perl and python support dynamic mode, all other plugins force you to the Emperor.

+3
source

All Articles