Search squid archive

Re: Max throughput of CARP Proxy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 4, 2010 at 12:05 PM, Markus Meyer <markus.meyer@xxxxxxxx> wrote:
> Kinkie schrieb:
>
> Hi Kinkie,
>
>>> Any ideas and hints are welcome.
>>
>> Go multi-instance on the CARP box. You can do load-balancing there via
>> iptables or via socket shuffling.
>
> With multi-instance you mean running several Squids on the same box? But
>  how do I differentiate between them? They are accessed from the
> Internet via port 80.
>
> Also can you point me in the right direction on how to accomplish this
> with Iptables?

you run two  instances, say one on port 80 and one on port 81.
Then:
iptables -t nat -A PREROUTING -m conntrack --ctstate
RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A PREROUTING -p tcp -m statistic --mode random
--probability 0.5 \
  -m tcp --dport 80 -j REDIRECT --to-ports 81

For more instances, use more ports, and replicate the second line as
many times as needed (also remember to change the probability).

> What is socket shuffling?

squid 2.7 supports a '-I' command-line option, which will make it
accept requests on stdin instead of a socket. I recall seeing (but
unfortunately can't find) a PERL script which performed the network
part of accepting a request, and then maintained a farm of squid
servers to which it passed requets this way.

The iptables method is probably more efficient, as the load-balancing
is done directly in the kernel.

-- 
    /kinkie


[Index of Archives]     [Linux Audio Users]     [Samba]     [Big List of Linux Books]     [Linux USB]     [Yosemite News]

  Powered by Linux