|
/
Zope
/
Apsis
/
Pound Mailing List
/
Archive
/
2008
/
2008-02
/
Allowing active sessions to finish, but not new sessions to backend?
[
Trouble Shooting 2.4 / FatBoyThin ... ]
[
Pound Cookie Size Limit in 2.4 / "Alfonso ... ]
Allowing active sessions to finish, but not new sessions to backend?
"Mattias Berge" <mattiasb(at)travelstart.se> |
2008-02-21 15:12:39 |
[ FULL ]
|
Hi,
This isnt 100% related to pound configuration, but im writing to this list
as I hope one of you guys have got a tip for me in which direction I should
go.
our problem:
Sometimes our java (tomcat+apache) backends get too high load (or atleast
stop responding), and connections time out.
What we do today:
Controlling each backend locally once every minute with a piece of perl
code, and if no response within x seconds and after y attempts in a row, the
script restarts the tomcat and apache. This causes current active users on
the affected backend to have to wait some time before being able to proceed.
(timeout, alive and some other variables added I suppose).
What we would like to do instead:
When a backend gets too much load, or stop responding after x seconds and y
tries in a row, Pound should allow all CURRENT sessions to the overloaded
backend, but NOT directing NEW sessions (until backend is back in normal
state).
How would you have solved this?
Do you think a custom solution with, say, some perl code on both the pound
and the backends would be the right way to do it or is there maybe a better
approach?
Thanks in advance,
[...]
|
|
|
|
|
Re: [Pound Mailing List] Allowing active sessions to finish, but not new sessions to backend?
Dave Steinberg <dave(at)redterror.net> |
2008-02-21 15:51:41 |
[ FULL ]
|
> How would you have solved this?[...]
I think first you'd have to give pound the ability to do the "let
existing connections complete but don't add new ones" part. I'm
guessing you'd need to start by adding a new state for backends, maybe
"Closing" - then make the rest of the code aware of it. The natural
question, then, is how do you differentiate "Closing" from "Dead"?
Assuming that can be solved - that, combined with the HAPort feature
(with your perl script listening on the other end), would get you what
you want. Or a perl script to call poundctl to mark the backend as Closing.
I'm guessing that adding the "no new connections" feature may be
invasive. Try working up a patch and sending to the list. The Pound
source is remarkably clear IMHO.
PS - This also nicely solves the problem of doing graceful restarts of
backends, i.e. so in-progress requests aren't disturbed.
Regards,[...]
|
|
|
Re: [Pound Mailing List] Allowing active sessions to finish, but not new sessions to backend?
Dave Steinberg <dave(at)redterror.net> |
2008-02-21 15:54:34 |
[ FULL ]
|
> How would you have solved this?[...]
Another solution that occurred to me after I hit send - if you have a
perl script on the load balancer that can adjust the priority of the
backend downward when its load gets higher, that may essentially have
the same effect you're looking for. Naturally, restore the priority as
load dropped.
The big benefit is that it doesn't rely on pound to know anything about
what you're doing.
[...]
|
|
|
|