Skip to main content
QUICK REVIEW

[Paper Review] Load Balancer Tuning: Comparative Analysis of HAProxy Load Balancing Methods

Connor Rawls, Mohsen Amini Salehi|arXiv (Cornell University)|Dec 29, 2022
Cloud Computing and Resource ManagementComputer Science4 citations
TL;DR

This paper evaluates HAProxy's load balancing algorithms under diverse workloads and backend configurations, demonstrating that thread count tuning and algorithm selection significantly impact response time and resource efficiency. It identifies random, leastconn, and roundrobin as optimal for homogeneous environments, while ALB-based methods outperform NLB in heterogeneous setups, offering actionable tuning guidelines for cloud cost and performance optimization.

ABSTRACT

Load balancing is prevalent in practical application (e.g., web) deployments seen today. One such load balancer, HAProxy, remains relevant as an open-source, easy-to-use system. In the context of web systems, the load balancer tier possesses significant influence over system performance and the incurred cost, which is decisive for cloud-based deployments. Therefore, it is imperative to properly tune the load balancer configuration and get the most performance out of the existing resources. In this technical report, we first introduce the HAProxy architecture and its load balancing methods. Then, we discuss fine-tuning parameters within this load balancer and examine their performances in face of various workload intensities. Our evaluation encompasses various types of web requests and homogeneous and heterogeneous back-ends. Lastly, based on the findings of this study, we present a set of best practices to optimally configure HAProxy.

Motivation & Objective

  • To evaluate HAProxy's performance across different load balancing algorithms under varying workload intensities.
  • To investigate the impact of configuration parameters, particularly thread count, on response time and system efficiency.
  • To compare the effectiveness of Network Layer (NLB) and Application Layer (ALB) load balancing methods in homogeneous and heterogeneous backend environments.
  • To provide data-driven best practices for tuning HAProxy to minimize cloud costs and maximize performance.

Proposed method

  • Benchmarking HAProxy using real-world web workloads across homogeneous and heterogeneous backend server configurations.
  • Implementing custom CPU utilization monitoring via libvirt to inform dynamic load balancing decisions.
  • Extending HAProxy's source code with a custom random algorithm that filters servers based on real-time CPU utilization thresholds.
  • Compiling the modified HAProxy with additional libraries (e.g., libvirt) using Makefile configuration and custom compilation flags.
  • Measuring response time and system throughput across multiple load balancing algorithms and thread configurations.
  • Analyzing performance trends under increasing request loads to identify algorithmic and configuration trade-offs.

Experimental results

Research questions

  • RQ1How does the number of processing threads in HAProxy affect response time in isolated and shared-host environments?
  • RQ2Which load balancing algorithms (e.g., random, leastconn, roundrobin) deliver the lowest response times in homogeneous backend server environments?
  • RQ3How do ALB-based algorithms compare to NLB-based algorithms in terms of performance when backend servers have heterogeneous capacities?
  • RQ4What is the impact of server heterogeneity on load balancing performance, and which algorithms best exploit it?
  • RQ5Can custom-tuned algorithms that consider real-time server metrics (e.g., CPU utilization) improve load balancing efficiency?

Key findings

  • Using the default number of processing threads in HAProxy yields the best response time when running in isolation, but reducing threads slightly improves performance when HAProxy shares the host with other processes.
  • In homogeneous backend environments, random, leastconn, roundrobin, and static-rr algorithms achieve the lowest and most consistent response times with minimal deviation.
  • ALB-based algorithms that consider application-layer information and server state outperform their NLB counterparts in heterogeneous server environments.
  • For heterogeneous backends, algorithms like source or URI-based hashing are necessary to achieve acceptable performance, as generic algorithms may lead to imbalanced workloads.
  • Customizing HAProxy with real-time CPU utilization monitoring allows for smarter request routing, reducing the risk of overloading high-utilization servers.
  • The study identifies a clear trade-off between algorithm complexity and performance gain, with simple algorithms often outperforming complex ones in practice.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.