[prog] httpd, accept from forked processes

Tim King timk at jtse.com
Tue Mar 31 16:22:05 UTC 2009


"Sam Watkins" <swatkins at fastmail.fm> wrote:

> I'm writing a webserver, it is working well, it uses select / epoll, and
> forks two processes both of which try to accept new connections...
Hi, Sam. Usually, the code accepts new connections from a single parent 
thread/process. Then it creates/forks a new thread/process to handle 
each new connection.

Some servers (like Apache) keep a bunch of active processes around to 
handle new connections after they've been accepted, which improves 
performance under heavy load. Maybe that's what you were thinking of.

What do you think?

TimK

-- 
http://www.JTimothyKing.com/
 - fiction, stories, blog, writing, e-marketing, web development




More information about the Programming mailing list