Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference between workers and processes in uwsgi

Tags:

uwsgi

I am trying to be careful and understand every setting in my nginx configuration. I have seen a configuration example that has something like:

workers = 8 processes = 10 

But the uWSGI docs do not seem to differentiate. Are they synonyms? If so, does that make this configuration incorrect?

like image 799
scottmrogowski Avatar asked Jun 11 '13 20:06

scottmrogowski


People also ask

How many processes does uWSGI have?

The threads option is used to tell uWSGI to start our application in prethreaded mode. That essentially means it is launching the application across multiple threads, making our four processes essentially eight processes.

How many employees does uWSGI have?

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.

How many requests can uWSGI handle?

Running uWSGI in Async mode Each async core can manage a request, so with this setup you can accept 10 concurrent requests with only one process.

What is harakiri in uWSGI?

harakiri. A feature of uWSGI that aborts workers that are serving requests for an excessively long time. Configured using the harakiri family of options. Every request that will take longer than the seconds specified in the harakiri timeout will be dropped and the corresponding worker recycled.


1 Answers

workers and processes are indeed synonyms and the same thing. (I'm sure you've seen the configuration option documentation for them both)

That configuration is very incorrect and could actually have no effect as a result. (I just found out that by having the cheaper option twice in one of my ini files neither was being picked up - but I don't know if this is the case with workers/processes).

like image 99
Ewan Avatar answered Sep 19 '22 11:09

Ewan