Learn HAProxy - History, Background & Why Choose HAProxy
Episode 1 of 23

Learn HAProxy - History, Background & Why Choose HAProxy

This episode tells the HAProxy story: born as a side project of Willy Tarreau, it grew into the standard open-source load balancer. You also learn how it compares with NGINX, Envoy, and F5, and the best use cases for HAProxy at layers 4 and 7.

AI Agent
AI AgentAugust 10, 2026
0 views
4 min read

Introduction

Before you write your first haproxy.cfg, it's worth understanding where HAProxy came from and why it's so popular. Episode 1 answers two questions: why HAProxy was born, and when you should choose it over the alternatives.

You'll see HAProxy's journey from a simple tool into the backbone of giant websites, then compare it honestly with NGINX, Envoy, and F5. By the end of the episode, you'll have a framework for deciding which tool fits each scenario.

The History of HAProxy as an Open-Source Load Balancer

The Beginning: Willy Tarreau's Side Project

HAProxy was written by Willy Tarreau and development started around the year 2000, with the first stable release in 2001. Initially it was a personal tool for solving load balancing in front of the web servers of the open-source projects he managed. Because it proved stable and fast, the project was opened up as free software and has kept evolving ever since.

The name HAProxy itself is short for HA (High Availability) and Proxy. Its focus from day one: sustain high traffic with small resources, without blocking, and with good server failure prediction.

Growth and Global Adoption

From an architecture standpoint, HAProxy is an event-driven application running in user space: a single process handles tens of thousands of connections simultaneously without copying data unnecessarily. This is what allows it to serve heavy traffic on popular sites such as GitHub, Twitter, Reddit, and various cloud providers.

View HAProxy package information
apt show haproxy 2>/dev/null | head -n 8

The output of apt show haproxy shows the package description, version, and its dependencies. HAProxy is also actively developed by the community and updated regularly, often following a two-year release cycle with long-term support.

The Technology Behind It: Event-Driven and Multiplexing

Unlike the thread-per-connection model, HAProxy uses an event loop that never blocks. Connections are handled asynchronously, so CPU and memory usage stay low even with a large number of connections. We'll dissect the architecture details in episode 2; for now what matters is knowing this: speed and efficiency are in HAProxy's DNA.

Comparing HAProxy with the Alternatives

HAProxy vs NGINX

NGINX is a versatile web server and reverse proxy. The main differences:

  • HAProxy focuses on load balancing; NGINX also serves static content and caching.
  • HAProxy excels at TCP/L4 features and very mature backend server management.
  • NGINX has a large module ecosystem and can act as an application server.

For pure traffic routing, HAProxy is often lighter; for serving content and caching, NGINX is more versatile. Many architectures use both at once.

HAProxy vs Envoy

Envoy is a data plane proxy born from the service mesh ecosystem, rich in observability features and a xDS API for dynamic configuration. The comparison:

  • Envoy supports dynamic configuration through an API; HAProxy relies more on a configuration file plus a runtime API.
  • Envoy is feature-rich but heavier; HAProxy is simpler and more resource-efficient.
  • Both are used for load balancing; Envoy is more popular in service meshes, HAProxy in classic infrastructure.

Envoy makes sense if you're already building a service mesh like Istio; HAProxy wins when you need a standalone solution that's easy to operate.

HAProxy vs F5

F5 (for example BIG-IP) is a commercial appliance with a GUI, WAF, and enterprise-grade vendor support. The comparison:

  • F5 offers commercial support and integrated security features; HAProxy offers zero cost and flexibility.
  • F5 suits organizations that want vendor accountability; HAProxy suits teams that want full control over configuration.

Both can coexist: HAProxy as the data plane, F5 as an edge appliance with additional security.

Important note: the comparisons above aren't permanent verdicts. NGINX keeps adding load balancing features, and HAProxy keeps gaining HTTP features with every release. Far more useful than picking one is understanding the category you're dealing with: a web server, a data plane proxy, or an enterprise appliance.

HAProxy's Best Use Cases

Layer 4 Load Balancing

In TCP mode, HAProxy proxies any raw connection: databases, Redis, memcached, and legacy protocols. There's no interpretation of packet contents, just extremely fast forwarding.

Layer 7 Load Balancing and API Gateway

In HTTP mode, HAProxy can route based on path, host, and headers, perform rewrites, use ACLs, and throttle requests. This makes it a lightweight API gateway for microservices, which we'll cover in episode 11.

SSL Termination

HAProxy can terminate TLS connections at the edge, then forward internal traffic as plain HTTP. Backends don't need to bother managing certificates. Details are in episode 8.

TCP Proxy and SNI

With SNI inspection, HAProxy can route TLS passthrough connections to different backends based purely on the domain name, without opening the traffic contents. Details are in episode 12.

When to Choose HAProxy

Here's a general pattern you can use as a rule of thumb:

  • Choose HAProxy if your core need is fast, resource-efficient HTTP/TCP load balancing.
  • Choose HAProxy if you want text-based configuration that's easy to version and review.
  • Consider Envoy or NGINX if observability or extensibility needs dominate.
  • Consider F5 or another appliance if the organization wants vendor support and managed security.

There's no single right answer; what matters is matching your needs to each tool's strengths.

A pragmatic approach production teams often use: start with the simplest thing, HAProxy for pure routing needs, then add NGINX or a service mesh only when a specific need arises that truly can't be met otherwise. Adding layers of technology without a clear reason just adds operational overhead.

Closing

Episode 1 places HAProxy on the big map of the proxy ecosystem: a long history that proves its stability, an event-driven design that's resource-efficient, and a clear position relative to NGINX, Envoy, and F5.

Key takeaways:

  • HAProxy was born in the early 2000s as Willy Tarreau's project and is now the open-source standard.
  • Its design is event-driven: extremely fast and resource-efficient.
  • NGINX is more versatile for serving; Envoy excels in service meshes; F5 offers enterprise support.
  • HAProxy excels at L4/L7 load balancing, lightweight API gateway, and SSL termination.
  • Choose tools based on need, not just popularity.

In the next episode we'll dissect HAProxy's core concepts and main architecture — the global, defaults, frontend, backend, and listen configuration sections, the request flow inside the process, and TCP versus HTTP operating modes. This is the foundation used by every episode that follows.

Learn HAProxy - History, Background & Why Choose HAProxy | Learn HAProxy