khaines
1/13/2008 3:05:00 PM
On Sun, 13 Jan 2008, Thomas Hurst wrote:
> Is it infeasable to support preforking after the listen socket's been
> opened, so many processes serve off the same port? I've done this for a
> while now with FastCGI and other Ruby servers.
>
> When I questioned Zed about it re mongrel a few years ago he mentioned
> something about IO streams getting confused, which I've never seen;
> perhaps OS-specific, on systems where concurrent accept() on a socket
> isn't supported?
The problem with this approach is really just that it's viability is an
accident. It's not described in any spec that I have ever seen on how
Linux networks should behave. It's not guaranteed to continue working,
and there's no guarantee that it will continue to be implemented in a way
that fairly distributes requests.
So yes, on some platforms (Linux), it works, and has worked for quite a
while. But IMHO, using it for anything important is risky, and if one's
app gets enough traffic that it needs a cluster, it would seem to me that
it's probably important enough to warrant using something that's actually
designed to operate as a load balancer and that is guaranteed to be a load
balancer in the future.
Kirk Haines