Re: unequal load distribution

From: Ulric Eriksson (ulric@siag.nu)
Date: Thu Oct 16 2003 - 23:10:35 CEST


On Thu, 16 Oct 2003, Pavel Jezek wrote:

> Hi,
> I'm planning to use PEN as load balancer for two SQUID http caches and
> distribute load between two line to Internet (but with different
> capacity 512kb and 256kb).
> So, is possible, that PEN forwards twice more requests to first cache
> (connected to 512 kb line) than second cache (256kb), like this example?
>
> pen -h 3128 cache-isp1 cache-isp2 cache-isp1

That command line should work unchanged. Pen will see three backend
servers, two of which are in fact the same (cache-isp1). Assuming equal
distribution among the three servers, cache-isp1 will serve twice as many
clients as cache-isp2.

There's a gotcha to look out for. I assume that you're using the hash as a
means to distribute clients in a predictable way among the squids. Now, if
one of the squids, say cache-isp1, goes down for whatever reason, all the
clients will be sent to cache-isp2. Since the hash algorithm uses client
tracking (what some call stickyness), they will stay on cache-isp2 even
when cache-isp1 comes back up. You probably don't want that. It can be
solved using one of two methods.

1. Use round-robin distribution of clients. That will bypass client
tracking completely, but it also means that every client will access
all the caches. That's bad for caching efficiency.

2. Make the table of tracked clients so small that it will overflow, i.e.
add the command line argument -c 1. The default number is 2048, which is
somewhat appropriate for a small website.

Don't try to use -c 0, because pen insists on storing the clients.

So the complete command line would be (untested):

pen -h -c 1 3128 cache-isp1 cache-isp1 cache-isp2

Ulric



This archive was generated by hypermail 2.1.2 : Thu Oct 16 2003 - 23:10:58 CEST