Workers scheduler


#1

Hello everyone,

I’m wondering how nginx is balancing requests process among the
different workers.

Is there a scheduler ? If yes, what’s the algorithm ?

I’d like to use fair queuing for my workers (i.e. send a new request to
process to the least loaded worker, based on CPU, memory or IO wait for
exemple).

Thanks in advance.


#2

On Fri, Mar 13, 2009 at 01:09:32AM +0100, Michael Baudino wrote:

I’m wondering how nginx is balancing requests process among the
different workers.

Is there a scheduler ? If yes, what’s the algorithm ?

I’d like to use fair queuing for my workers (i.e. send a new request to
process to the least loaded worker, based on CPU, memory or IO wait for
exemple).

There is no workers scheduler. Workers try to hold accept_mutex which
allows only one worker to get new connections notification and to call
accept(). You can switch accept_mutex off, then all scheduling will be
done by OS scheduler via accept() call.