Re: Load Balancing Connections

Theo Schlossnagle <[email protected]> Fri, 10 Oct 2003 08:49:31 -0400
Newsgroups gmane.comp.apache.mod-backhand.general
Message-ID <[email protected]>
On Friday, Oct 10, 2003, at 08:11 US/Eastern, Rob Clews wrote:
> I wish to use a load balancer which then forwards to other nodes in a
> network. Previously I've been using other software on the load 
> balancer,
> but when the requests hit the load balancer which are then forwarded on
> they stay on the load balancer. The result is that the load balancer
> gets filled up with TCP_TIME_WAITs and after x amount of requests will
> not handle any more.
>
> Is there a way of using mod_backhand so that the clients do not leave a
> connection on the load balancer?
>  <snip>
> Obviously the load balancer is the single point of failure currently,
> that will change later. We will be receiving a large amount of requests
> and the focus is on speed other than availability.

This has little to do with mod_backhand.  It is a TCP/IP stack tuning 
issue.  You should be able to reduce the amount of time TCP/IP 
connections are kept in TIME_WAIT.  This could be due to improperly 
shutting down the TCP/IP connection from the load balancer.

mod_bakchand doesn't do anything to exacerbate the problem, but it is 
still a kernel tuning issue (on Linux, Solaris and FreeBSD).

On Linux and FreeBSD you can use sysctl to modify the appropriate tcp 
timeouts in the kernel's TCP/IP stack.

On Solaris, you can use ndd.

// Theo Schlossnagle
// Principal Engineer -- http://www.omniti.com/~jesus/
// Postal Engine -- http://www.postalengine.com/
// Ecelerity: fastest MTA on earth