Mailing List Archive

Load Balancing Connections
Hi,

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?

Example network

--------
| LB |
--------
/\
/ \
/ \
------ ------
| N1 | | N2 |
------ ------

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.

Thanks in advance,
Rob Clews
Load Balancing Connections [ In reply to ]
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
Load Balancing Connections [ In reply to ]
On Fri, 2003-10-10 at 13:49, Theo Schlossnagle wrote:
> On Friday, Oct 10, 2003, at 08:11 US/Eastern, Rob Clews wrote:
> > Is there a way of using mod_backhand so that the clients do not leave a
> > connection on the load balancer?
>
> On Linux and FreeBSD you can use sysctl to modify the appropriate tcp
> timeouts in the kernel's TCP/IP stack.

Yeah, this is what I've used in the past, how do other people overcome this problem with a huge amount of requests? Or is it due to the load balancer being broken? I'm using FreeBSD btw.

Cheers
Rob Clews