Many thanks, I’m clear now. Zhou.
在 15/11/12 下午3:27, "Willy Tarreau" <[email protected]> 写入: >Hi, > >On Tue, Nov 10, 2015 at 07:50:56AM +0000, Zhou,Qingzhi wrote: >> Hi?? >> Thanks very much. >> But I think we can use listener_full instead of limit_listener if we >>want >> wake up the listener when there??s a connection closed. Like in the >> beginning of listener_accept: >> >> if (unlikely(l->nbconn >= l->maxconn)) { >> listener_full(l); >> return; >> } >> >> >> WHY not using listener_full ? > >Because the listener is not full. If it were full, it would have been >handled by the test you pointed above. Here we're in the situation where >the frontend's maxconn is reached before the listener is full. So you >have 2 listeners in a frontend each getting half the number of >connections. > >We know that we won't be able to accept any new connection on this >listener >until some connections are released on the frontend. So by calling >limit_listener() we temporarily pause the listener and add it to the >frontend's queue to be enabled again when the frontend releases >connections. There's no reason to add a delay here because we know >exactly when connections are released on this frontend. So trying this >again will not change anything. > >Hoping this helps, >Willy >

