Wensong Zhang wrote:
Hi,
On Fri, 6 Feb 2004, Brett E. wrote:
I would like to write a static scheduler which would not use the
connection hash table and instead, upon each packet arrival for a
virtual server, generate a hash number given the source IP and map the
client to one of the real servers.
Just one comment. Maybe you need to create another table to assoicate hash
number and real server. If you use static function to map hash number to
real server, there will be a lot of problems when real servers are added
or deleted in the cluster.
Regards,
Wensong
To tackle this I was thinking of first creating an array of buckets
where each real server gets W buckets if its weight is W. We then hash
the source IP, mod it by the number of buckets, and choose a real
server. So let's assume all weights are 1 and there are, say, 16 real
servers so we create an array with 16 elements. When one real server
goes down we would mark the array entry for that real server as down.
If we hash to that array entry we would then generate another hash and
map it to the remaining active realservers (15). If another realserver
goes down, we would connections to it to the available real servers(14).
This means TCP connections mapped to the 2 inactive real server will
become invalidated, but the rest will be fine. So around 2/16 or 1/8 of
the traffic is affected.
|