From the announcement on Freshmeat:
Servers can be assigned weights to account for differing capacity. New
penctl commands control the weight of each server and turns on or off
weights for the server selection algorithm. The code in add_client was
simplified so that the weighted server selection can be used with or
without client tracking.
Why is this useful?
If we have one fast and one slow server, we may want to send more traffic
to the fast one. That was previously only possible by listing the fast
server more than once. Changing the weight dynamically in a convenient
manner wasn't possible.
Now there is a new penctl command to set the weight:
server S weight W
By default all servers have a weight of 0, which means that they will
never be chosen as candidates. The server selection algorithm will then
fall back on round robin. Changing the weight is only possible through the
penctl interface or from a configuration file like in this example:
8<---
server 0 address 10.0.0.10 port 80 weight 2
server 1 address 10.0.0.11 port 80 weight 1
server 2 address 10.0.0.12 port 80 weight 1
roundrobin
weight
8<---
The change in add_client was to make it possible to combine several server
selection algorithms. Now the logic is like this:
if we're not using roundrobin
look up the client
if we find it
try the old server
if successful
Done!
if we're using weight
try the least loaded server
if successful
Done!
if we're using hash
try the calculated server
if successful
Done!
if we're not stubborn
try all servers in turn (i.e. roundrobin)
if successful
Done!
if we have an emergency server
try it
if successful
Done!
if we get here, give up
So in the example configuration file above, we're using weight but not
client tracking. This is usually a good setting unless there is state on
the servers. In that case leave out roundrobin.
Ulric
This archive was generated by hypermail 2.1.2 : Tue Jul 06 2004 - 12:55:31 CEST