Quantcast

Workers scheduler

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Workers scheduler

Michael Baudino
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.

--
Michael Baudino


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Workers scheduler

Igor Sysoev
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.


--
Igor Sysoev
http://sysoev.ru/en/

Loading...