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 ...

Get OpenShift Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.