What is the uWSGI master process for?
and/or where can I read more about it?
I have found zero documentation for it.
uWSGI is an open source software application that "aims at developing a full stack for building hosting services". It is named after the Web Server Gateway Interface (WSGI), which was the first plugin supported by the project.
Can I then ditch NGINX? uWSGI could be used as a standalone web server in production, but that is not it's intentional use. It may sound odd, but uWSGI was always supposed to be a go-between a full-featured web server like NGINX and your Python files.
Remember: lazy-apps is different from lazy, the first one only instructs uWSGI to load the application one time per worker, while the second is more invasive (and generally discouraged) as it changes a lot of internal defaults.
This configuration will tell uWSGI to run up to 10 workers under load. If the app is idle uWSGI will stop workers but it will always leave at least 2 of them running. With cheaper-initial you can control how many workers should be spawned at startup.
You can find some information about master here and here
Generally speaking, master file is responsible for graceful reloading your app server (so there is as little as possible down time when you're reloading your app), it manages preforking and enables threading for app instances. It also manages some advanced logging features and keeps your app instances up and running (when one of instance crashes, master will re-launch it). It probably also manages harakiri mode (it kills hanged workers).
Generally speaking, using master is recommended for your apps, unless you're using emperor.
Running emperor (not vassals, but emperor by itself) with master process is recommended only if you need some of benefits that master gives, for example advanced logging. You can also skip master for your vassals, because emperor will do some of work that normally vassal does, but not all of it. I personally use master for vassals.
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