LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: LVS and multiple squid instances

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: LVS and multiple squid instances
Cc: Georg Stein1 <GSTEIN@xxxxxxxxxx>
From: Stefan Schmidt <zaphodb--lvs-users@xxxxxxxxxxx>
Date: Thu, 17 Mar 2005 18:49:59 +0100
On Thu, Mar 03, 2005 at 10:14:13PM +0100, Carsten Thieswald1 wrote:
> We have currently 4 powerful machines with 4 virtual CPU's each and 
> RHAS30. Current we run LVS DR and on each systems is an active squid 
> instance. Unfortunately squid doesn't scale well on SMP systems. To 
> improve the performance I want to run additional squid instances on 
> virtual ip addresses and different ports. The loopback interface would be 
> able to serve the requests but they can't be addressed by the LVS 
> director. The VIP Port can't be changed. I found an interesting hint from 
> Francois Jeanmougin by using Port NAT with iptables on the Real Server:
> 
> realserver:/# /sbin/iptables -t nat -A PREROUTING -d VIP -p tcp -m tcp 
> --dport 80 -j DNAT --to-destination VIP
> 
> But this doesn't solve my problem. This rules makes pnat to all packets 
> destined to VIP:Port and already before it is decided which vitrtual 
> interface to use eth0:0 or eth0:1. 
In my recursive Nameserver cluster setup i use multiple 'real' 802.1q/vlan
Interfaces to distribute the load to multiple named instances with DNAT and
specifying the Interface on the Realserver:
iptables -t nat -A PREROUTING -i eth1.105 -d <ServiceIP> -p tcp --dport 53 -j 
DNAT --to-destination 10.1.53.2:53
the named process listens on 10.1.53.2:53 which is also the RealserverIP.
The virtual Interface notation you used is misleading as it implies that you
can use it as a 'real' Interface but it really is just an alias and the
Interface the kernel uses is really still eth0.

Sorry for the Cisco terminology but i find it is easier to remember what is
meant by it. 

        Stefan
-- 
In The Beginning there was nothing, which exploded.

<Prev in Thread] Current Thread [Next in Thread>