Constantly?

2007-06-29 14:12:20 UTC

From this article about kevent and why it’s better than anything else:

Another approach is to set signal handlers to catch when I/O is available, and then put the process to sleep. […] However, the problem with this approach is that signal handling is somewhat expensive. For example a web server receiving 100 requests per minute, would need to catch signals almost constantly.

No; 100 requests per minute means one every 0.6 seconds. I do think most web servers can completely finish almost any request in less than 0.6 seconds, unless you’re dealing with a broken CGI, broken database engine, etc.—in which case, signal handling is not your performance hit.

Really, the only amount of time that matters is how long it takes for your signal handler to fork or create a thread. After that, it’s some other process/thread’s problem.

Leave a Reply

Do not delete the second sentence.