Re: Load balancing on Multiple squid cache

From: Michael Sparks <>
Date: Mon, 25 Oct 1999 13:49:58 +0100 (BST)

On Mon, 25 Oct 1999 wrote:

> Hello friends
> We are launching filtered service and using squid 2.3 Stable 5 with
> squidguard. I have to use squid as transparent proxy so I can block the URL
> through SquidGuard. How can I apply load balancing on multiple squid. How
> should I use the squid to divide equal load on multilple squids.

It depends on how much traffic you're trying to balance over how many
servers. Currently we're testing the Linux Virtual Servers stuff
( and that's producing extremely good results,
so far and allows you to place servers on different subnets from the load
balancer. The reason for this is the load balancer can make use of IPIP
tunneling to forward the client portion of the request to the server, and
the server can then respond directly to the client, bypassing the load

Since the server to client portion of traffic is >> than the client to
server portion the proxy server's bandwidth is likely to get saturated
before the load balancer gets close to being saturated.

The LVS stuff is essentially just a (free) kernel patch to the linux
kernel to give you flexible level 4 routing of requests, whereas level 7
switches which are supposed partition the requests between the servers. ie
the latter ensures no duplication of content, the former leaves that up to

If all your squid boxes are peering with each other (eg using cache
digests, with no-query) then this gives you virtually the same result
anyway. (although the true cluster hit rate becomes harder to measure)
Inside one of our non-LVS clusters, we've got about 16 servers peerng
using digests in an M*N style peering, which sounds extreme, but seems to
work suprisingly well. We're in the process of looking into building a
digest for the cluster in order to simplify scaling the system better for
our cache's clients - which are caches as well. (ie an intra-cluster peers
get normal digests, extra-cluster peers get the cluster digest)

So far through our test cluster we've been pushing >5 million requests a
day through the load balancer over 3 servers and it's looking fairly good.
ie given 3 servers and X requests in total, the ideal is X/3 requests per
server - the LVS stuff is within .4% of optimal. Current load through the
system looks like:

IP Virtual Server version 0.8.3 (size=4096)
Protocol LocalAddress:Port Scheduler Flags
      -> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP A.B.C.D:80 wlc
      -> X.Y.Z.1:80 Tunnel 1 0 0
TCP A.B.C.D:8080 wlc
      -> X.Y.Z.2:8080 Tunnel 1000 1824 2918
      -> X.Y.Z.3:8080 Tunnel 1000 1828 2760
      -> X.Y.Z.4:8080 Tunnel 1000 1822 2860

(IP addresses changed to protect the innocent :)

We'll be ramping load up on it to more useful levels after we done a few
more tests.

Michael Sparks.

National & Local Web Cache Support        R: G117
Manchester Computing                      T: 0161 275 7195
University of Manchester                  F: 0161 275 6040
Manchester UK M13 9PL                     M:
> Shahnawaz Ali
Received on Mon Oct 25 1999 - 07:39:57 MDT

This archive was generated by hypermail pre-2.1.9 : Tue Dec 09 2003 - 16:49:03 MST