Re: [squid-users] Load Balancing Query

From: Amos Jeffries <squid3_at_treenet.co.nz>
Date: Tue, 16 Jun 2009 00:30:28 +1200

Mario Remy Almeida wrote:
> Hi Amos,
>
> Thanks for that,
>
> so I need to use carp and sourcehash to do load balancing, right?

only the one you want.

>
> but where do I specify in squid to monitor the prots?
>
> I mean if port 8080 is down on 'ServerA' how Squid will know that it
> should send the request to 'ServerB' on port 8080?

It's automatic in the background.

The latest 2.HEAD and 3.1 have options to configure how long it takes to
detect. Other squid attempt ~10 connects and then failover.

Amos

>
> //Remy
>
> On Mon, 2009-06-15 at 23:05 +1200, Amos Jeffries wrote:
>> Mario Remy Almeida wrote:
>>> Hi All,
>>>
>>> Want to know if load balancing is possible with squid by maintaining
>>> sessions.
>>> Health check should be TCP Ports
>>>
>>> eg:
>>> Server A -> Active port 8080
>>> Server B -> Active port 8080
>>>
>>> Client -> Squid -> Server A and/or B
>>>
>>> Request 1 comes from 'Client A' Squid forwards the request to 'Server A'
>>> Request 2 comes from 'Client A' Squid forwards the request to 'Server A'
>>> and so on
>>> any further request from 'Client A' squid should only forward to 'Server
>>> A' until the session is same
>>>
>>> if
>>>
>>> Request 1 comes from 'Client B' Squid forwards the request to 'Server B'
>>> Request 2 comes from 'Client B' Squid forwards the request to 'Server B'
>>>
>>> if 'Server A' fails Squid should forward all the request to 'Server B'
>>>
>>> //Remy
>>>
>>
>> HTTP is stateless. It contains no such thing as sessions. That is a
>> browser feature.
>>
>> What you are looking for is something like CARP or sourcehash peering
>> algorithms. They keep all requests for certain URLs sent to the same
>> place (CARP) or all requests for the same IP to the same place (sourcehash).
>>
>> see
>> http://www.squid-cache.org/Doc/config/cache_peer
>>
>>
>> Amos
>
>

-- 
Please be using
   Current Stable Squid 2.7.STABLE6 or 3.0.STABLE15
   Current Beta Squid 3.1.0.8 or 3.0.STABLE16-RC1
Received on Mon Jun 15 2009 - 12:30:35 MDT

This archive was generated by hypermail 2.2.0 : Mon Jun 15 2009 - 12:00:03 MDT