Este contenido no está disponible en el idioma seleccionado.
13.4.4. Scaling Action Hooks
Automatic scaling is controlled by the
haproxy_ctld
daemon. The haproxy_ctld.rb
script, which changes the thresholds and algorithms used to control scale up and down behavior, can be customized for use as an action hook in scalable applications.
Procedure 13.3. To Customize Automatic Scaling for an Application:
- Use SSH to connect to a scalable application and consult the generic
~/haproxy/usr/bin/haproxy_ctld.rb
script for detailed usage information. - Copy the file to the Git repository of the application in the
App_Name/.openshift/action_hooks/
directory. - Ensure the file is executable:
chmod +x App_Name/.openshift/action_hooks/haproxy_ctld.rb
# chmod +x App_Name/.openshift/action_hooks/haproxy_ctld.rbchmod +x App_Name/.openshift/action_hooks/haproxy_ctld.rbchmod +x App_Name/.openshift/action_hooks/haproxy_ctld.rb
Copy to Clipboard Copied! Toggle word wrap Toggle overflow - Edit the file to the desired specifications.
- Deploy the changes. To ensure that the changes take effect immediately, the HAProxy cartridge restarts automatically during deployment if the
haproxy_ctld.rb
action hook is detected.
Example 13.2. Scaling Up Based on Memory Usage
To enable auto-scaling based on memory usage, edit the
~/haproxy/usr/bin/haproxy_ctld.rb
script by specifying the following parameters.