Persistence vs SH scheduler

Martijn Grendelman martijn at grendelman.net
Fri Jun 9 16:12:19 BST 2006


Hi,

>>>> When I first started to toy around with LVS, I did just what is written
>>>> here:
>>>> i tried to use the SH scheduler for "session affinity" at L7.
>>> Looking at your original post from 2004, you are using source hashing with a
>>> weight of 1.  This will result in the service being overloaded when the
>>> number
>>> of connections is greater than 2, as your output of ipvsadm shows.  Have you
>>> tried increasing the weight?
>> No I haven't. Can you explain why a weight of 1 will result in the service
>> being overloaded, and how would weight = 2 make a difference?
>>
>> As I understand it, the weight only specifies the relative weight of the real
>> servers. It has nothing to do with the actual number of connections. Am I
>> wrong? My current setup also has weight = 1 for all real servers.
> 
> The weight when used with SH and DH has a different meaning than most, if not
> all, the other standard LVS scheduling methods.  Although this doesn't appear
> to be mentioned in the man page for ipvsadm.
> 
>>From ip_vs_sh.c
> 
> 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;

That would explain the things I saw.

In the mean time, I went back to a configuration with the SH scheduler 
and a weight for both real servers of 200, and things seem to run fine.

Thank you for the advice!

Best regards,

Martijn Grendelman


Search lvs-users Archives
Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort

More information about the lvs-users mailing list