|
From: | Martin Pala |
Subject: | Re: monit http server exit |
Date: | Mon, 15 Sep 2003 00:47:59 +0200 |
User-agent: | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030908 Debian/1.4-4 |
Jan-Henrik Haukeland wrote:
I looked on FreeBSD, NetBSD, OpenBSD now - it is implemented too (Solaris and Linux works well).Martin Pala <address@hidden> writes:Martin Pala wrote:Hmm, monit http server blocks on accept(), which causes it not to exit until it receives connection. It will be needed to implement some sort of wakeup or timeout to finalize it gracefully without waiting for the connection to stop the server. I'll look on it.I looked on it - probably the best way will be to make monit http server non-blocking. What do you think?Absolutely, the previous implementation was really not good. Using poll like you have done is the right way and the best way to do this, but poll does not exist on all systems, and I'm uncertain about *BSD systems if they actually has poll. CAN SOMEONE PLEASE VERIFY!! (If they do not have poll, using select instead of poll is an option since I'm pretty sure most systems has select).
MartinP.S. In my project i plan to use little bit esoteric interfaces such as epoll (linux 2.6), /dev/poll (solaris), kqueue (BSD) and completion ports (windows). These interfaces have advantage over select and poll in the case, that the server maintains lot of inactive connections (which is not monit's case). Interesting paper on various factors which has influence to servers performance (such as select, poll and other alternatives) is at http://www.kegel.com/c10k.html :)
[Prev in Thread] | Current Thread | [Next in Thread] |