Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 04-13-2007, 02:25 AM   #1
LQ Newbie
Registered: Apr 2007
Distribution: Debian, Fedora Core and SuSE
Posts: 8

Rep: Reputation: 0
Squid Load Balancing

I am not sure if I can do this but here goes...

My setup is this. Me and a mate have our own networks and internet connections, but have our networks linked by wifi. The wifi cards are in linux routers, which also route onto the internet, and each run squid. However, as these are domestic internet connections, we cannot bond the connections, to provide faster connections.

My solution to this is: get squid to distribute the load between the connections. What I would like is:
  • Local squid receives request
  • Checks if it is in cache, if so return it
  • Checks if it is in other squid's cache, if so get and return it
  • If not, use a weighted round robin to distribute between directly getting file or forwarding request to other squid (which would know it's from it's peer so not use this step)
The main use for this would be to allow 'segmented downloads' (eg from getright/aria2 etc) to pull each segment off a different link, and also provide fault tolerance (it is unlikely that both ISP's will go down at once), and I would also set up QoS so that each of us still had priority on our own link (I can max out mine and use the spare on theirs without them noticing any severe slowdown, and vice versa).

Any ideas? I could do something similar using redirectors, but this would rewrite URL's so I don't know if it would cache correctly (under original URL), and also resuming may be a problem. I also want to make sure that some sites this doesnt happen with (ones which check IP's and link login to that, and any that mess up with this configuration)
Old 04-14-2007, 02:31 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
if i was wanting to use this scenario as you've described it i'd probably be looking at a proxy configuration file to laod balance directly from the client. using a logic like this from the client, the proxies do ont need to care that the other exists, as all clients would always go to the same proxy for a certain kind of url. in my own experience though you have an issue with things like login sessions if you are spreading a site such as this one between two proxies which have different public ip addresses, as half the time (ish) your requests come from a different address to the one you logged in on, so may end up logging in multiple times and worse. as such i'd *probably* suggest encoding by domain name, not full url, so requests to always go to a single proxy...

additionally maybe you'd rather just look at chapter4 of from this logic, you'd always want to query the peer cache if you wish to keep two, but each squid box is (presuambly) able to use either uplink on a more effective load balance.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Balancing Winanjaya Linux - Networking 3 10-03-2006 08:13 AM
load balancing cirogl Linux - Enterprise 3 05-25-2006 04:46 PM
Load Balancing otisthegbs Linux - Networking 4 02-10-2005 02:16 PM
Load balancing ?? Lucsi Linux - Newbie 1 07-16-2002 12:54 PM
squid with load balancing (?) no2nt Linux - Networking 1 09-12-2001 09:25 AM > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 10:22 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration