Bug 1013166 - [RFE] Add the ability to adjust when haproxy shutsdown the app cart in the lead gear
[RFE] Add the ability to adjust when haproxy shutsdown the app cart in the le...
Product: OpenShift Online
Classification: Red Hat
Component: Image (Show other bugs)
x86_64 Linux
medium Severity medium
: ---
: ---
Assigned To: Ben Parees
libra bugs
: Documentation
Depends On:
Blocks: 1013167
  Show dependency treegraph
Reported: 2013-09-27 19:41 EDT by Timothy Williams
Modified: 2014-04-28 02:49 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1013167 (view as bug list)
Last Closed: 2014-04-24 17:34:41 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Timothy Williams 2013-09-27 19:41:44 EDT
Description of problem:
Currently, haproxy, when scaled to 3 or more gears, will shutdown the application cartridge (i.e. ruby, python, php, etc) in the gear that also houses haproxy so that haproxy has access to the entire gear's resources. It is requested that the number of gears required to shutdown the application cartridge be adjustable.

The goal of this is to allow the application creator to have one haproxy gear and just one application gear or , if load permits, have 3 total gears and still have the application cartridge running on the haproxy gear.

Additional info:

Current upstream/1.2/2.0 code:


122 # Disable the local endpoint if one of the remote gears is available and it
123 # isn't already disabled
124 if [ $(grep -E "server\s*gear" $HAPROXY_CONFIG | wc -l) -ge 2 ]; then
125     if grep "local-gear" $HAPROXY_CONFIG | grep "weight 0" &>/dev/null; then
126         echo "Local gear already disabled in config. "
127     else
128         echo "Disabling local gear in the config. "
129         nohup $OPENSHIFT_HAPROXY_DIR/usr/bin/fix_local.sh &
130     fi
131 fi

If we change "2" to an adjustable environment variable in line 124, this should achieve the goal. I am unsure if this is the method development would like to take.
Comment 1 Ben Parees 2014-04-09 11:11:50 EDT
Adding a new OPENSHIFT_HAPROXY_GEAR_RATIO env var that can be used to override the default of "3".  This will need to be documented.
Comment 3 Meng Bo 2014-04-11 07:48:45 EDT
Checked on devenv_4547, issue has been fixed.

The new env has been introduced. And works well.

After set the OPENSHIFT_HAPROXY_GEAR_RATIO to 4, the head gear will not DOWN when there are 3 gears. And will DOWN when there are 4 gears.

Move bug to verified.

Note You need to log in before you can comment on or make changes to this bug.