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;
}
}
}
}