Difference between revisions of "Source Hashing Scheduling"

From LVSKB
Jump to: navigation, search
Line 1: Line 1:
 
The source hashing scheduling algorithm assigns network connections to the servers through looking up a statically assigned hash table by their source IP addresses.
 
The source hashing scheduling algorithm assigns network connections to the servers through looking up a statically assigned hash table by their source IP addresses.
  
''Maybe, it would be nice to put this in the HOWTO, a lot of people, me too, don't understand why SH seems to lose connections. It's not a bug but a misconfiguration due to a lack of documentation. (The manpage of ipvsadm doesn't mention the following:''
+
''Maybe, it would be nice to put this in the HOWTO, a lot of people, me too, don't understand why SH seems to lose connections. It's not a bug but a misconfiguration due to a lack of documentation. (The manpage of ipvsadm doesn't mention the following)''
  
 
'''But''', careful, the weight of a realserver with the SH scheduler means the maximum number of connections, multiplied by 2, allowed on this realserver. The meaning of the weight argument is very different in SH and DH than RR, LC and others.  
 
'''But''', careful, the weight of a realserver with the SH scheduler means the maximum number of connections, multiplied by 2, allowed on this realserver. The meaning of the weight argument is very different in SH and DH than RR, LC and others.  
  
Just read this thread lvs-users : [http://archive.linuxvirtualserver.org/html/lvs-users/2006-06/msg00001.html Persistence vs SH scheduler]. Thanks to Martijn Grendelman to pointing this out.
+
Just read this thread in lvs-users : [http://archive.linuxvirtualserver.org/html/lvs-users/2006-06/msg00001.html Persistence vs SH scheduler]. Thanks to Martijn Grendelman to pointing this out.
  
 
<pre>
 
<pre>

Revision as of 21:33, 16 June 2006

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

Maybe, it would be nice to put this in the HOWTO, a lot of people, me too, don't understand why SH seems to lose connections. It's not a bug but a misconfiguration due to a lack of documentation. (The manpage of ipvsadm doesn't mention the following)

But, careful, the weight of a realserver with the SH scheduler means the maximum number of connections, multiplied by 2, allowed on this realserver. The meaning of the weight argument is very different in SH and DH than RR, LC and others.

Just read this thread in lvs-users : Persistence vs SH scheduler. Thanks to Martijn Grendelman to pointing this out.

The sh algorithm is to select server by the hash key of source IP
address. The pseudo code is as follows:

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

      return n;