In a multi-worker (multi-process) gunicorn setup, how does the master (that is the gunicorn dispatcher process) decide to which worker (process) the request is given to?
Does gunicorn check the workload (processor usage) of each worker in order to decide?
Does it schedule according to the Round-Robin method?
Does it simply remember which worker isn't handling a request at the moment because it had already returned a response earlier so that this is waiting for the next request? And if all workers are busy it simply puts the request in a queue and waits for the first worker to return a response from a previous request and then hands over the request from the queue?
I was unable to find any explicit means of dispatching in gunicorn source code, my best bet is that the request is handled by whoever is first to either select
in case of sync
worker or polls first in case of threaded worker.
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