markcaudill/haproxy-autoscale — Issue #2: haproxy restarts constantly although configuration has not changed
Author: phrozendice
Created: 2012-02-02 19:20:50+00:00
State: open

Hey Mark,

I am doing some more testing, so far so good, excellent addition with the multiple security groups. One thing I found though is that when I cron the script to run every minute it restarts haproxy even though there are no new instances to add (or remove). See the log file bellow:

Feb 2 14:16:01 127.0.0.1 haproxy[4210]: Proxy demo_services started.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Pausing frontend demo.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Pausing frontend demo_services.
Feb 2 14:16:01 127.0.0.1 haproxy[4210]: Proxy demo started.
Feb 2 14:16:01 127.0.0.1 haproxy[4210]: Proxy demo_services started.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Stopping frontend demo in 0 ms.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Stopping backend demo_portal in 0 ms.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Stopping frontend demo_services in 0 ms.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Stopping backend demo_services in 0 ms.
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Proxy demo stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Proxy demo_portal stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:16:01 127.0.0.1 haproxy[4203]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:17:01 127.0.0.1 haproxy[4218]: Proxy demo_portal started.
Feb 2 14:17:01 127.0.0.1 haproxy[4218]: Proxy demo_services started.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Pausing frontend demo.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Pausing frontend demo_services.
Feb 2 14:17:01 127.0.0.1 haproxy[4218]: Proxy demo started.
Feb 2 14:17:01 127.0.0.1 haproxy[4218]: Proxy demo_services started.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Stopping frontend demo in 0 ms.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Stopping backend demo_portal in 0 ms.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Stopping frontend demo_services in 0 ms.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Stopping backend demo_services in 0 ms.
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Proxy demo stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Proxy demo_portal stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:17:01 127.0.0.1 haproxy[4211]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:18:02 127.0.0.1 haproxy[4226]: Proxy demo_portal started.
Feb 2 14:18:02 127.0.0.1 haproxy[4226]: Proxy demo_services started.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Pausing frontend demo.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Pausing frontend demo_services.
Feb 2 14:18:02 127.0.0.1 haproxy[4226]: Proxy demo started.
Feb 2 14:18:02 127.0.0.1 haproxy[4226]: Proxy demo_services started.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Stopping frontend demo in 0 ms.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Stopping backend demo_portal in 0 ms.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Stopping frontend demo_services in 0 ms.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Stopping backend demo_services in 0 ms.
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Proxy demo stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Proxy demo_portal stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:18:02 127.0.0.1 haproxy[4219]: Proxy demo_services stopped (FE: 0 conns, BE: 0 conns).
Feb 2 14:19:02 127.0.0.1 haproxy[4235]: Proxy demo_portal started.
Feb 2 14:19:02 127.0.0.1 haproxy[4235]: Proxy demo_services started.
Feb 2 14:19:02 127.0.0.1 haproxy[4227]: Pausing frontend demo.
Feb 2 14:19:02 127.0.0.1 haproxy[4227]: Pausing frontend demo_services.
Feb 2 14:19:02 127.0.0.1 haproxy[4235]: Proxy demo started.
Feb 2 14:19:02 127.0.0.1 haproxy[4235]: Proxy demo_services started.

Is there any special configuration I need to do to make it restart only when it detects changes?

Thank you in advance!