LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] DR-mode realserver selection via consistent hashing on r

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] DR-mode realserver selection via consistent hashing on request URL?
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Fri, 27 Nov 2009 23:23:11 +1100
On Tue, Nov 17, 2009 at 02:37:37PM -0800, Josh Adams wrote:
> On Tue, Nov 17, 2009 at 13:34, Joseph Mack NA3T <jmack@xxxxxxxx> wrote:
> > -dh maps on urls, not IPs (it was developed for squids).
> >
> > The urls are divided evenly over the realservers. Otherwise
> > I don't know the answer to your question.
> 
> Ok, thanks for the clarification.  I expected dh to be based on ip
> because of what I saw in the source in my kernel's ip_vs_dh.c
> (linux-2.6.27.y/net/ipv4/ipvs/ip_vs_dh.c):
> 
>     18  /*
>     19   * The dh algorithm is to select server by the hash key of
> destination IP
>     20   * address. The pseudo code is as follows:
>     21   *
>     22   *       n <- servernode[dest_ip];
>     23   *       if (n is dead) OR
>     24   *          (n is overloaded) OR (n.weight <= 0) then
>     25   *                 return NULL;
>     26   *
>     27   *       return n;
>     28   *
>     29   * Notes that servernode is a 256-bucket hash table that maps the hash
>     30   * index derived from packet destination IP address to the
> current server
>     31   * array. If the dh scheduler is used in cache cluster, it is good to
>     32   * combine it with cache_bypass feature. When the statically assigned
>     33   * server is dead or overloaded, the load balancer can bypass the 
> cache
>     34   * server and send requests to the original server directly.
>     35   *
>     36   */
> 
> Has this been changed to url-based hashing in a later version of
> ip_vs_dh.c or am I just looking in the wrong place (ie, is there
> another dh scheduler somewhere else)?  The consistent hashing-like
> redistribution of down realservers' objects question still applies,
> but I guess I can find that out by reading the source of the url-based
> dh scheduler.

Hi Josh,

your assumption is correct. The dh scheduler for IPVS works on addresses
not URLs. IPVS works at L4, does not have access to higher-level
information such as URLs and thus can't use such information in
its schedulers.

The kind of scheduling you are after generally takes place
at layer 7. I imagine that squid can do such things. Ultramonkey-L7
also has this kind of facility.


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

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