The only live manipulation you can do is through poundctl. You can enable and disable backends. You cannot add or remove backends. It is conceivable you could pre-allocate backends that aren’t currently in service, and turn them on and off. Of course, with session affinity, they’d only be useful for new sessions from the time you make them active.
As someone who does run a large scale production site, I can’t see how adding a backend would be something you’d be doing a lot… Or something you couldn’t just schedule for a maintenance window. Perhaps your use case is overly niche. If you really need to do it, you could look at my Backend Cookies patch. It would require you to use a pound-generated cookie instead of a client-supplied header. But it also means the browser itself retains the affinity information if the pound database is cleared. (i.e. the service restarts, the machine reboots or crashes) Or, you can use poundctl’s –N option to inject sessions. Basic procedure is something like this: 1) Adjust the config as necessary 2) Run poundctl or poundctl –X to get the full list of sessions currently active 3) Restart pound 4) Parse the results, running poundctl –N once for each session to repopulate the session database. Using my InitScript patch, I did some experiments with a script that would run after the listeners and services were created, but before the socket started accepting requests… the script I had it run would populate the session state. That way the restart was as seamless as possible. XML was saved, the service was restarted, which kicked off a script that used perl to parse the XML and generate the poundctl –N lines. It wasn’t the most elegant solution, and it was very specific to my environment, but it worked. Other than those suggestions, you’re welcome to implement some extension to poundctl that allows adding backends. Of course, you’d still have to add them to the config, for whenever you next restart the service, or write some sort of config file rewriter extension. The locking and backend selection mechanisms in Pound do not currently allow for those values to change underneath a thread. (Number of backends is populated at config parse time, locking locks the entire list, linked-lists would have to be thread safe for insertion as well as reading) I would feel comfortable saying deletion would never happen. Best you’d have is “disable and send this host’s requests elsewhere”. (Right now I believe disable does a graceful disable/quiesce type operation which lets existing sessions stall out) If you spend any time in the list archives, dynamic configuration is not something likely to happen anytime soon. No one can agree on 1) whether it’s even needed or not, 2) The extent of what different software options would need to be adjusted at any given time, 3) how such a thing might be implemented (since no consensus on 2 was ever reached). While commercial load balancing appliances have this feature, it hasn’t been something pound has ever really needed to support… and pound’s mantra has always been small, efficient, resource friendly, as few dependencies as possible, be autonomous, be as transparent as possible, never write to the disk after startup, and leave any complicated features for extensions. Things that have been requested that fall outside these boundaries (Dynamic/PCRE based URL rewriting, content rewriting, authentication handled by pound rather than backends, interactive/web based config management UI’s, built-in health checking [you have to write a script], dynamic configuration, safe process restarting, session DB replication, real LB clustering, etc…) have never gained traction. Personally I don’t have a problem with this… I think Pound does what it does very well. Anything else I want it to do, I add. Which is why my github fork has more features than Pound stock. But as with any hobbyist coder, I’m more apt to implement what I need. :) Joe From: Brad Allison [mailto:[email protected]] Sent: Monday, June 17, 2013 12:55 PM To: [email protected] Subject: Re: [Pound Mailing List] Re: restarting pound with new config and session affinity (dynamically add a backend server) I read the thread and it doesn't answer my question.... Or is the lack of an answer the answer. You just can't reload pound configs dynamically to add in a new backend server. Which makes pound pretty useless for an application that needs to be up all the time. I can't take the time to restart pound when all I want to do is add in a new back end server. Restarting pound means everyone gets dropped and has to log back end. Because we require the session affinity that pound offers (Type=Header, ID=Host) and restarting pound breaks that. -b On Mon, Jun 17, 2013 at 12:19 PM, Alan McGinlay <[email protected]<mailto:[email protected]>> wrote: This previous thread from 2007 touches on the subject with some good advice: http://www.apsis.ch/pound/pound_list/archive/2007/2007-09/1189689850000 Kristine, you mean like in most init scripts? Poundctl doesn't have "reload" as an option so neither does the init script (afaik) /a On mån 17 jun 2013 16:50:25, Kristine N. Putnam wrote: Have you tried using the "reload" command instead of "restart"? -Kristine ------------------------------------------------------------------------ *From: *"Brad Allison" <[email protected]<mailto:[email protected]>> *To: *[email protected]<mailto:[email protected]> *Sent: *Monday, June 17, 2013 10:39:29 AM *Subject: *[Pound Mailing List] Re: restarting pound with new config and session affinity (dynamically add a backend server) Hello? Is this thing on? Someone hijacked my thread... but didn't answer my questions... On Mon, Jun 10, 2013 at 12:53 PM, Brad Allison <[email protected]<mailto:[email protected]> <mailto:[email protected]<mailto:[email protected]>>> wrote: We use session affinity that pound offers (Type=Header, ID=Host). But if we restart pound everyone goes to a different backend server than the one they had affinity for. 1- Now, we want to dynamically add a new pound server to the pound configuration, but we don't want to restart pound because again, everyone would be logged off our product if we did that. So how do we dynamically add in a new backend server without restarting pound? 2- Same question except this time removing a backend server. How do I remove a backend server from pound without restarting pound and losing all the session affinity? -brad -- To unsubscribe send an email with subject unsubscribe to [email protected]<mailto:[email protected]>. Please contact [email protected]<mailto:[email protected]> for questions.
