[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files



On 2010-09-03 03:49, Yee Keat Phuah wrote:
> I am using the http server part of libevent 2.0.6, and currently testing
> it under all sorts of situation. One of the situation I ran into is when
> there are too many connections, there might be "Too Many Open Files"
> returned from the accept() call, that is ok, but the problem is because
> in listener.c:listener_read_cb() function, there's no way I could
> intercept this error message, and maybe stop accepting new connections,
> what happen subsequently is that event_sock_warn just gets called
> thousands of time.
> 
> Is there a way that I can intercept this error and act accordingly?
> Probably stop listening for a while?

I'm also interested in knowing the answer to this.

So far, I've mitigated this problem by setting the limit on the number
of file descriptors to "a lot". But as far as I know, there is no way to
set it to "unlimited", so this situation will always be a possibility.

Simon
-- 
NAT64/DNS64 open-source --> http://ecdysis.viagenie.ca
STUN/TURN server        --> http://numb.viagenie.ca
vCard 4.0               --> http://www.vcarddav.org
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.