Forum: NGINX Workers scheduler

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Bb5a8d703dc867735a8f251efb4fdbda?d=identicon&s=25 Michael Baudino (Guest)
on 2009-03-13 01:18
(Received via mailing list)
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.
5640e332954fc0006aea97a155ce0afd?d=identicon&s=25 Igor Sysoev (Guest)
on 2009-03-13 07:50
(Received via mailing list)
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.
This topic is locked and can not be replied to.