/ Zope / Apsis / Pound Mailing List / Archive / 2005 / 2005-03 / Evening out the backends

[ << ] [ >> ]

[ Some patches you might find useful / Frank ... ] [ Redirection / Kevin Dennis ... ]

Evening out the backends
Ed R Zahurak <ezahurak(at)atlanticbb.net>
2005-03-11 03:56:14 [ FULL ]
Would anyone care to add to/patch Pound to slightly improve the backend 
selection?

The totally random approach doesn't seem to work very well -- while 
monitoring my servers sitting behind pound, I see many instances where 
pound will send 10, 20, 30 requests to one server, while the others sit 
there, completely idle.  Not an ideal situation.

(Also, does setting the connection priority in the group config actually 
have any effect?  Near as I could tell by looking at the source, it 
doesn't.)

If pound could be modified to do one of two things...

a. select the backend with the least amount of connections; in the case 
of a tie, select one at random from those with the least number of 
connections.

b. round-robin it - (e.g. with three backends, first connection goes to 
backend A, second to backend B, third to C, fourth to A, and so on.)

... I'd be mighty grateful.

Re: Evening out the backends
Jamie McCarthy <jamie(at)mccarthy.vg>
2005-03-12 18:27:57 [ FULL ]
ezahurak(at)atlanticbb.net (Ed R Zahurak) writes:
[...]

Assuming the random algorithm is actually pretty random, this is not
entirely unexpected.  Assuming some requests take more of your
webheads' resources than others, if you get by chance a few of the
heavy requests sent to one server, it slows down.  Since it takes
longer to process each request, the chances are better that it'll
still be working on them when the next heavy request comes in.
It snowballs.

A least-connections algorithm can alleviate this, but round-robin is
subject to exactly the same problem.[...]

Re: Evening out the backends
Ed R Zahurak <ezahurak(at)atlanticbb.net>
2005-03-13 05:27:11 [ FULL ]
It's not a case of a server getting a few heavy requests, then the other 
server getting a few light ones, then the bogged server getting more. 
It's a case where 10, 20, 30 requests are shotgunned to one server while
the other sits completely idle.

This happens in a live environment, and in a test environment, where a 
stress-test app is firing the same request over and over again at pound. 
  There are times when everything just gets slammed at one server. 
Random, perhaps, but still not very load-balancy.

Round-robin does actually help a little bit -- I _was_ able to hack this 
into the code fairly simply, I think.  It stops the shotgun, but, you're 
right, the situation you describe does pop up.  Thankfully, though, not 
very often, although more often in live than in test.  Least 
connections, would definately be better.  Unfortunately, that's a little 
beyond me at this point -- my C is about 10 years rusty.

Ed Z
ezahurak(at)atlanticbb.net

Jamie McCarthy wrote:[...][...][...]

MailBoxer