[lvs-users] DR-mode realserver selection via consistent hashing on request URL?
josh at gmail.com
Tue Nov 17 22:37:37 GMT 2009
On Tue, Nov 17, 2009 at 13:34, Joseph Mack NA3T <jmack at wm7d.net> 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
19 * The dh algorithm is to select server by the hash key of
20 * address. The pseudo code is as follows:
22 * n <- servernode[dest_ip];
23 * if (n is dead) OR
24 * (n is overloaded) OR (n.weight <= 0) then
25 * return NULL;
27 * return n;
29 * Notes that servernode is a 256-bucket hash table that maps the hash
30 * index derived from packet destination IP address to the
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.
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
More information about the lvs-users