Difference between revisions of "Destination Hashing Scheduling"

From LVSKB
Jump to: navigation, search
(add pseudo code)
m
 
Line 9: Line 9:
 
   
 
   
 
       return n;
 
       return n;
 +
 
  Notes that servernode is a 256-bucket hash table that maps the hash
 
  Notes that servernode is a 256-bucket hash table that maps the hash
 
  index derived from packet destination IP address to the current server
 
  index derived from packet destination IP address to the current server

Latest revision as of 15:30, 17 June 2007

The destination hashing scheduling algorithm assigns network connections to the servers through looking up a statically assigned hash table by their destination IP addresses.

The DH scheduling algorithm is to select server by the hash key of destination IP address. The pseudo code is as follows:

      n <- servernode[dest_ip];
      if (n is dead) OR
         (n is overloaded, such as n.conns>2*n.weight) then
                return NULL;

      return n;

Notes that servernode is a 256-bucket hash table that maps the hash
index derived from packet destination IP address to the current server
array.

If the dh scheduler is used in cache cluster, it is good to combine it with cache_bypass feature. When the statically assigned server is dead or overloaded, the load balancer can bypass the cache server and send requests to the original server directly.