Pen 0.15.0

From: Ulric Eriksson (
Date: Tue Jul 06 2004 - 12:55:15 CEST

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:

server 0 address port 80 weight 2
server 1 address port 80 weight 1
server 2 address port 80 weight 1

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

if we're using weight
        try the least loaded server
        if successful

if we're using hash
        try the calculated server
        if successful

if we're not stubborn
        try all servers in turn (i.e. roundrobin)
        if successful

if we have an emergency server
        try it
        if successful

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.


This archive was generated by hypermail 2.1.2 : Tue Jul 06 2004 - 12:55:31 CEST