I can share the  setup  that reproduces the issue (Note: I have excluded a
lot of config to isolate the issue):

(Note: Just a note though, there was no traffic and I waited for 30
minutes.  It only happens with two  reload happens at same time)

*1*. *Ubuntu 14.04 LTS* with *HAProxy* installed using backports
sudo apt-get install haproxy/*trusty-backports*

*2*. With out of the box config provided (see attached) for the ubuntu
platform, simply reload the config twice (make sure that reload logic
happens in background) : (See below)
#!/bin/bash -c
#This is a test script to reproduce the issue. This is not our production
logic.
#Simply reload twice in back ground and check for haproxy process
service haproxy reload &
service haproxy reload &

*3*. Run the script : sudo bash reload.sh

*4.* Grep for haproxy process :
*ps -efl | grep haproxy.cfg | grep -v grep*
1 S haproxy 16253 2191 0 80 0 - 7245 ep_pol 00:33 ? 00:00:00
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D
-sf 16173 1 S haproxy 16254 2191 0 80 0 - 7245 ep_pol 00:33 ? 00:00:00
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D
-sf 16173

*5.* Repeat step 2-4 , you will notice there process count has increased by
1 more :
1 S haproxy  16253  2191  0  80   0 -  7245 ep_pol 00:33 ?        00:00:00
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D
-sf 16173
1 S haproxy  16303  2191  0  80   0 -  7245 ep_pol 00:34 ?        00:00:00
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D
-sf 16254
1 S haproxy  16304  2191  0  80   0 -  7245 ep_pol 00:34 ?        00:00:00
/usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg -p /var/run/haproxy.pid -D
-sf 16254


*6. *Modify the reload script and do not reload it in background
#!/bin/bash -c
service haproxy reload
service haproxy reload

*7*. Kill all processes and repeat steps 3-4 (several times)
You will notice that old process do not stackup as before.
ps -efl | grep haproxy.cfg | grep -v grep 1 S haproxy 16513 2191 0 80 0 -
7245 ep_pol 00:38 ? 00:00:00 /usr/sbin/haproxy -f /etc/haproxy/haproxy.cfg
-p /var/run/haproxy.pid -D -sf 16494

Sukrit




On Mon, Aug 4, 2014 at 12:00 AM, Baptiste <[email protected]> wrote:

> On Mon, Aug 4, 2014 at 6:15 AM, Sukrit Khera <[email protected]> wrote:
> > We are planning to setup proxy service using HaProxy. We realized that
> when
> > we send multiple reload signals at same time,  haproxy process count
> > increases and the old process do not die.
> >
> > If we serialize the reload requests( i.e. execute one after other), we do
> > not see the leak.
> >
> > Note : This happens even when there is not traffic to the site and the
> old
> > process never die.
> >
> > sukrit@sukrit-dev:~$ haproxy -v
> > HA-Proxy version 1.5.3 2014/07/25
> >
> > Linux (Ubuntu Trusty 14.04) : 3.13.0-32-generic
> >
> > Test Script :
> > service haproxy reload &
> > service haproxy reload &
> >
> > Use Case: We are providing proxy as a service to our internal apps to do
> a
> > blue green deploy. Once new app comes up, we do a reload. SInce we have
> > multiple workers running which processes the deployment request, at
> times we
> > might have 2 proxy requests being served at same time.
> >
> > I was wondering if that is intended behavior and our script should handle
> > the serialization of request or if it is a bug.
> >
> > Thanks and Regards
> > Sukrit Khera
>
>
> Hi Sukrit,
>
> This behavior occurs by design.
> Can you share with us your configuration?
> Old processes remains active as long as it has an active connection.
> A connection could remain active because there is data exchanged on it
> or because you set up very long time outs.
>
> Could you share with us your configuration (don't forget to anonymize it)
>
> Baptiste
>



--

Attachment: haproxy.cfg
Description: Binary data

Reply via email to