On 3 December 2012 21:00, Rama Alebouyeh <[email protected]> wrote: > Hi Baptiste. > > Thanks for your respond. > By context switch here I mean when HAProxy switches from one backend to > another. My bad for not using a correct term. > In my case some of the servers are in both backends. > > To better understand the HAProxy functionality and based on your > explanation, Is it safe to assume that every time HAProxy switches from one > back-end to another it reloads?
Absolutely not! HAProxy can manage many thousand simultaneous connections whilst running as one process. Each of these connections has (to the best of my knowledge) strong *isolation* inside HAProxy so that (except for deliberately shared entities such as sticky tables) they can't interfere with each other. Is that perhaps what you're thinking about? > Does it do that by forking? HAProxy forks a number of children when it is restarted (or, I believe, reloaded) from the server's CLI - perhaps from an init script. I don't /believe/ it forks any children subsequently without some outside agent (user ssh'd to the server; cluster management software; etc) asking it to restart or reload. > All that said. Is there a way, either by configuration or by 3rd party > software, to maintain one active backup server for an active server pool of > "n" in such a way that the backup become active when once active server goes > down? I understand what you're asking, and think that others will let you know how to achieve this. Whilst it may be possible, I don't think this maps very well to HAProxy's vanilla setup. Usually, one would 1) put *all* the servers capable of serving "normal" traffic into service 2) configure how servers have to be responding to health checks for the service to be considered "up" 3) configure backup servers for the service to use instead of the normal server pool, once the service has been determined to have gone "down" as per the criteria you defined in #2. If it's possible for you to align your setup with this methodology, you may find fewer oddities later on :-) HTH, Jonathan -- Jonathan Matthews // Oxford, London, UK http://www.jpluscplusm.com/contact.html

