August 03, 2014 10:47PM
hello,

I still can't understand why accept_mutex cause disbalance. In code below, multi worker will try to get mutex and the question is , why one worker can always get the mutex ? I test many times, find that one worker can always accept new connection much more than others. Thanks very much.

if (ngx_use_accept_mutex) {
if (ngx_accept_disabled > 0) {
ngx_accept_disabled--;

} else {
if (ngx_trylock_accept_mutex(cycle) == NGX_ERROR) {
return;
}

if (ngx_accept_mutex_held) {
flags |= NGX_POST_EVENTS;

} else {
if (timer == NGX_TIMER_INFINITE
|| timer > ngx_accept_mutex_delay)
{
timer = ngx_accept_mutex_delay;
}
}
}
}
Subject Author Posted

accpet_mutex cause nginx worker balance problem

xinghua_hi August 03, 2014 09:29AM

Re: accpet_mutex cause nginx worker balance problem

Maxim Dounin August 03, 2014 03:44PM

Re: accpet_mutex cause nginx worker balance problem

xinghua_hi August 03, 2014 10:47PM

Re: accpet_mutex cause nginx worker balance problem

Maxim Dounin August 04, 2014 10:58AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 172
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready