HAProxy
HAProxy (High Availability Proxy) is a free, open-source TCP and HTTP load balancer and reverse proxy known for high performance and reliability.
Definition
HAProxy (High Availability Proxy) is a free, open-source TCP and HTTP load balancer and reverse proxy known for high performance and reliability.
Overview
HAProxy, created by Willy Tarreau in 2000 and written in C for speed and low resource use, distributes incoming traffic across a pool of backend servers using configurable algorithms such as round robin, least connections, and source-IP hashing. Its configuration file defines `frontend` sections (how traffic is received) and `backend` sections (where traffic is sent), along with health checks that automatically remove unhealthy servers from rotation. Beyond basic load balancing, HAProxy supports SSL/TLS termination, sticky sessions, rate limiting, ACL-based routing rules, and detailed real-time statistics through its built-in stats page or Prometheus-compatible metrics. Its predictable performance under high connection volume has made it a long-standing choice for both TCP-level (layer 4) and HTTP-level (layer 7) load balancing in front of web applications, APIs, and databases. HAProxy is frequently deployed in front of application servers, Kubernetes ingress controllers, and database clusters, and it is commonly compared with alternatives like Nginx and Envoy depending on whether teams need pure load-balancing focus (HAProxy), a combined web-server/proxy (Nginx), or service-mesh-grade dynamic configuration (Envoy).
Key Features
- Layer 4 (TCP) and layer 7 (HTTP) load balancing in a single tool
- Multiple load-balancing algorithms including round robin, least connections, and IP hash
- Active and passive health checks that remove failing backends automatically
- SSL/TLS termination and ACL-based traffic routing
- Built-in real-time statistics dashboard and Prometheus-compatible metrics
- High throughput with low memory and CPU overhead, written in C