Description of problem: Provide support for customizing the haproxy auto scaling algorithm. The following pull request needs to be merged into Enterprise 2. https://github.com/openshift/origin-server/pull/4323
Upstream commits: commit 73b90a9488dac9c82e9ae8d4132e5d94d59a69c9 Author: Mike McGrath <mmcgrath> Date: Wed Dec 11 17:00:41 2013 -0600 checking for executible bits prior to execution commit 1e78a3bf067dc81e993639ea47a46887136eeb37 Author: Mike McGrath <mmcgrath> Date: Wed Dec 11 16:52:24 2013 -0600 updated typos as per pull request commit 1d5bbced6cd14a279b4e6b19921e416d4b29e142 Author: Mike McGrath <mmcgrath> Date: Wed Dec 11 14:59:51 2013 -0600 allow for customized haproxy_ctld.rb file to exist commit e5fb1073aa8425a6a213afd941d3fd08605f4672 Author: Mike McGrath <mmcgrath> Date: Wed Dec 11 14:24:48 2013 -0600 added haproxy_ctld comments and ability to run custom haproxy_ctld
I'm CC'ing Alex so docs can think about what they would like to do for this new feature. It's pretty simple to use. Check in your own implementation to /.openshift/action_hooks/haproxy_ctld.rb and make sure it's executable.
Test this feature with openshift-origin-cartridge-haproxy-1.17.3.4-1.el6op. Found the customized haproxy_ctld.rb action-hook will not take effect till the haproxy cartridge get restart. BZ#1057558 told more detail about this.
openshift enterprise: 2014-02-10.2 1. Create scalable app 2. Add haproxy_ctld.rb to .openshift/action_hooks/ with x permission 3. Git push the change remote: Deployment id is cb47259f remote: Activating deployment remote: HAProxy already running remote: Action hook haproxy_ctld.rb detected remote: Action hook haproxy_ctld.rb restarted remote: HAProxy instance is started
openshift enterprise: 2014-02-10.2 1. Create scalable app 2. Add customize haproxy_ctld.rb to .openshift/action_hooks/ with x permission FLAP_PROTECTION_TIME_SECONDS = 200 gear_up_pct = 30.0 3. Git push the change remote: Deployment id is cb47259f remote: Activating deployment remote: HAProxy already running remote: Action hook haproxy_ctld.rb detected remote: Action hook haproxy_ctld.rb restarted remote: HAProxy instance is started 4. check scale_events.log tailf /var/lib/openshift/$uuid/haproxy/logs/scale_events.log D, [2014-02-11T02:22:32.084319 #8945] DEBUG -- : GEAR_INFO - capacity: 6.25% gear_count: 1 sessions: 1 up/remove_thresh: 30.0%/1.0% sec_left_til_remove: 140 gear_remove_thresh: 0/20 D, [2014-02-11T02:22:37.690486 #8945] DEBUG -- : Local sessions 7 D, [2014-02-11T02:22:37.734693 #8945] DEBUG -- : Got stats from 0 remote proxies. I, [2014-02-11T02:22:37.785819 #8945] INFO -- : add-gear - capacity: 43.75% gear_count: 1 sessions: 7 up_thresh: 30.0% After 200 seconds: D, [2014-02-11T02:27:46.808533 #8945] DEBUG -- : Got stats from 0 remote proxies. D, [2014-02-11T02:27:46.808642 #8945] DEBUG -- : GEAR_INFO - capacity: 0.0% gear_count: 1 sessions: 0 up/remove_thresh: 30.0%/1.0% sec_left_til_remove: 0 gear_remove_thresh: 0/20 D, [2014-02-11T02:27:51.809914 #8945] DEBUG -- : Local sessions 0 D, [2014-02-11T02:27:51.812755 #8945] DEBUG -- : Got stats from 0 remote proxies.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. http://rhn.redhat.com/errata/RHBA-2014-0209.html