Configuring HAProxy to use a different balance algorithm
The HAProxy load balancer can work with several load-balancing algorithms. The configuration used by HAProxy in OpenShift applications uses the leastconn load-balancing algorithm. This algorithm is useful when you have long-lived connections, but is not recommended for short connections. For short connections, as in the case of our application, it is more suitable to use the roundrobin algorithm.
In this recipe, you will learn how to configure HAProxy to use the roundrobin balance algorithm instead of the leastconn algorithm.
Getting ready
To complete this recipe, you will need rhc
installed on your machine. This recipe will utilize the application created in the Creating scalable applications recipe.
How to do it…
Perform the following steps to configure HAProxy to use the roundrobin balance algorithm:
- Open a command-line terminal and navigate to the application directory created in the Creating scalable applications recipe.
- Scale...