Re: Stick tables and counters persistence
On Fri, Apr 17, 2015 at 9:46 PM, Dennis Jacobfeuerborn < denni...@conversis.de> wrote: > Yes, you add a peer section: > > peers haproxy-peers > peer haproxy1 127.0.0.1:1024 > > (haproxy1 must the the hostname of the local system) > > and then you add a reference to that peer section in you stick table > definition for example: > > stick-table type ip size 100k expire 20m peers haproxy-peers > > On a reload the new process will then sync the stick table from the old > process. > > If you want to do SSL offloading (and thus need nbproc>1) the best > workaround I found is to setup two haproxy instances (systemd makes that > pretty easy) one for the SSL offloading (nbproc>1) which then forwards > the traffic using abstract namespace socket to the other instance > (nbproc=1) that does the actual load-balancing. > > That way you can reload the balancing instance keeping the stick tables > but also utilize multiple cpu cores for SSL offloading. > > Regards, > Dennis On recent update it is given that now nbproc can be used along with peers. Another improvement consists in a relax of the restriction between peers > and nbproc. Now it is possible to use peers provided that the whole > section is only used by tables belonging to the same process. This makes > it easier to run SSL offloading in multiple processes now. Ah, and it's > also possible to disable a peers section without having to comment all > places where it's referenced! Can anyone provide a sample/example config for same? Jai
Re: Stick tables and counters persistence
On 18.04.2015 11:00, Igor Cicimov wrote: > On 18/04/2015 2:18 AM, "Dennis Jacobfeuerborn" > wrote: >> >> Yes, you add a peer section: >> >> peers haproxy-peers >> peer haproxy1 127.0.0.1:1024 >> >> (haproxy1 must the the hostname of the local system) >> >> and then you add a reference to that peer section in you stick table >> definition for example: >> >> stick-table type ip size 100k expire 20m peers haproxy-peers >> >> On a reload the new process will then sync the stick table from the old >> process. >> > What about restart? That depends how a restart/reload is implemented on your end. Usually a restart is supposed to be a clean fresh start of the application so you don't really want to copy data from the old process. Regards, Dennis
Re: Stick tables and counters persistence
Yes, you add a peer section: peers haproxy-peers peer haproxy1 127.0.0.1:1024 (haproxy1 must the the hostname of the local system) and then you add a reference to that peer section in you stick table definition for example: stick-table type ip size 100k expire 20m peers haproxy-peers On a reload the new process will then sync the stick table from the old process. If you want to do SSL offloading (and thus need nbproc>1) the best workaround I found is to setup two haproxy instances (systemd makes that pretty easy) one for the SSL offloading (nbproc>1) which then forwards the traffic using abstract namespace socket to the other instance (nbproc=1) that does the actual load-balancing. That way you can reload the balancing instance keeping the stick tables but also utilize multiple cpu cores for SSL offloading. Regards, Dennis On 17.04.2015 18:07, CJ Ess wrote: > Do you have an example of what that looks like? Am I literally adding > 127.0.0.1 as a peer? > > > On Fri, Apr 17, 2015 at 12:26 AM, Dennis Jacobfeuerborn < > denni...@conversis.de> wrote: > >> On 17.04.2015 02:12, Igor Cicimov wrote: >>> Hi all, >>> >>> Just a quick one, are the stick tables and counters persisted on haproxy >>> 1.5.11 reload/restart? >> >> With nbproc=1 yes as long as you use a peers section that contains the >> local host as an entry. >> >> Regards, >> Dennis >> >> >> >> >
Re: Stick tables and counters persistence
Do you have an example of what that looks like? Am I literally adding 127.0.0.1 as a peer? On Fri, Apr 17, 2015 at 12:26 AM, Dennis Jacobfeuerborn < denni...@conversis.de> wrote: > On 17.04.2015 02:12, Igor Cicimov wrote: > > Hi all, > > > > Just a quick one, are the stick tables and counters persisted on haproxy > > 1.5.11 reload/restart? > > With nbproc=1 yes as long as you use a peers section that contains the > local host as an entry. > > Regards, > Dennis > > > >
Re: Stick tables and counters persistence
On Fri, Apr 17, 2015 at 2:26 PM, Dennis Jacobfeuerborn < denni...@conversis.de> wrote: > On 17.04.2015 02:12, Igor Cicimov wrote: > > Hi all, > > > > Just a quick one, are the stick tables and counters persisted on haproxy > > 1.5.11 reload/restart? > > With nbproc=1 yes as long as you use a peers section that contains the > local host as an entry. > > Regards, > Dennis > > > > Thanks Dennis, yes that's exactly my user case ie peers and nbproc=1. Cheers, Igor
Re: Stick tables and counters persistence
On 17.04.2015 02:12, Igor Cicimov wrote: > Hi all, > > Just a quick one, are the stick tables and counters persisted on haproxy > 1.5.11 reload/restart? With nbproc=1 yes as long as you use a peers section that contains the local host as an entry. Regards, Dennis
Stick tables and counters persistence
Hi all, Just a quick one, are the stick tables and counters persisted on haproxy 1.5.11 reload/restart? Thanks, Igor