[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]
[Libevent-users] Stop listening on http server when accept() returns Too Many Open Files
- To: libevent-users@xxxxxxxxxxxxx
- Subject: [Libevent-users] Stop listening on http server when accept() returns Too Many Open Files
- From: Yee Keat Phuah <ykphuah@xxxxxxxxx>
- Date: Fri, 3 Sep 2010 15:49:11 +0800
- Delivered-to: archiver@xxxxxxxx
- Delivered-to: libevent-users-outgoing@xxxxxxxx
- Delivered-to: libevent-users@xxxxxxxx
- Delivery-date: Fri, 03 Sep 2010 03:49:19 -0400
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:date:message-id :subject:from:to:content-type; bh=MwQtYXIYYo+Rx0JxgX/oYmvM5RIkqhZ5PwxJgb8sCfg=; b=YeUjv+DjPSkEw0Pe59s8B6HAJX+ejFEA25nnHbzUoxF2vKtuC2huRn+MGBTx/urvdl wG7MkQfO6Z805jfItQlLDkeXBa+14txAzbPobNf8ViFsFgkk90MBQGoiNN4w+AtAMDIL yLw9mdqpLUsURu2yWf/g363fE9mtitfMHsK/o=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=HoXrh5gkp6PEiyy34pyH5nKOL6M33TQzoV3xArRWnVRJLiYJ0xrcL4r48mcTXWBRhY TKXfVWDxwgQ0yEULYZrjuVCJ8/R6fOuQ1R25hkQM5O/si89qPNBdGRF4fUlT0CJUiANm CW4t5IvZodggF1yaUdK4I7+v8XiAMml+ZhknI=
- Reply-to: libevent-users@xxxxxxxxxxxxx
- Sender: owner-libevent-users@xxxxxxxxxxxxx
Hi,
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?
Thanks in advance.
Cheers,
Phuah Yee Keat