Hi,

On Mon, Nov 09, 2015 at 12:46:57PM +0000, Zhou,Qingzhi wrote:
> if (unlikely(actconn >= global.maxconn) && !(l->options & LI_O_UNLIMITED)) {
> limit_listener(l, &global_listener_queue);
> task_schedule(global_listener_queue_task, tick_add(now_ms, 1000)); /* try 
> again in 1 second */
> return;
> }
> 
> if (unlikely(p && p->feconn >= p->maxconn)) {
> limit_listener(l, &p->listener_queue);   <??????here is my question.
> return;
> }
> 
> My question is why the task_schedule is not called again here? Any purpose?
> In my knowledge, if the upper limit is reached, we should re-schedule the
> task with expire time, and the listener will wake up when the task is ran.

No because if we're limited by the frontend itself, after we disable the
listener, we will automatically be woken up once a connection is released
there. It's when the global maxconn is reached that we want to reschedule
because there are some situations where we cannot reliably detect if
certain connections impacting global.maxconn have been released (eg:
outgoing peers connections and Lua cosockets count here).

Regards,
Willy


Reply via email to