/ Zope / Apsis / Pound Mailing List / Archive / 2005 / 2005-11 / Distributing the Load of a Failed Backend

[ << ] [ >> ]

[ Build pound without openssl / Arkadiusz Patyk ... ] [ Using pound.cfg to block web attacks, bad ... ]

Distributing the Load of a Failed Backend
Eric McCarthy <eric(at)desert.net>
2005-11-09 19:45:54 [ FULL ]
Hello,

We've been using Pound on various sites for the past year now, and  
it's proven to be a very reliable product. Many thanks to all those  
who have developed it!

One feature that we use on a semi-regular basis is backend fail-over.  
We will stop Apache on a backend to make configuration changes or to  
do performance experiments. Yesterday however, we noticed that Pound  
does not do what we would have expected, which is to redistribute the  
downed backend's requests across the remaining backends. Instead,  
Pound forwards all of the downed backend's requests to the next  
backend in its list.

Is this behavior intentional or is it a bug? It seems that the  
requests should be distributed, instead of bogging down one server.  
But perhaps there is a good reason for this?

This is the code in 1.9.4 that selects a backend that is alive. It's  
in a few places in get_be().

     orig = n = rand() % g->tot_pri;
     while(!g->backend_addr[n].alive) {
         n = (n + 1) % g->tot_pri;
         if(n == orig)
             break;
     }

There is a thr_prune() function that, in the comments, claims to  
prune dead hosts, however I can't find where it or any of it's  
callees does this. In any case, I think it would make more sense for  
kill_be() to remove a dead backend from the list of currently  
available backends than to have a separate thread that does this.

In 2.0b2 I think there may be a similar issue, but I haven't had the  
time to convince myself of it.

So am I correctly understanding the code? Is it a bug?

Thanks,
Eric

Re: [Pound Mailing List] Distributing the Load of a Failed Backend
Robert Segall <roseg(at)apsis.ch>
2005-11-10 14:55:05 [ FULL ]
On Wed, 2005-11-09 at 11:45 -0700, Eric McCarthy wrote:[...]

If if happens it's a bug.
[...]

As you can see the back-end is chosen at random.
[...]

The 2.x algorithm is quite different.[...]

Re: [Pound Mailing List] Distributing the Load of a Failed Backend
Eric McCarthy <eric(at)desert.net>
2005-11-10 17:15:12 [ FULL ]
> > This is the code in 1.9.4 that selects a backend that is alive. It's 
[...]

Yes and no. Initially, the back-end is chosen at random. However, if the
randomly chosen back-end's alive flag is 0, the request is always sent to
the next back-end in g->backend_addr. That results in that single backend
handling both its randomly assigned requests and all of the dead back-
end's requests.

-Eric

MailBoxer