What Is New in HAProxy 1.4
| Category | Key Changes |
|---|---|
| New Features | Server-Side Keep-Alive, Weighted LB Algorithms, ACL-based Persistence, Transparent Proxy Support |
| Protocol Support | HTTPS Health Checks, SSL Improvements, HTTP Query String Parsing |
| Core & Performance | Epoll Support, Memory Management, Connection Queue Control |
| Logging & Monitoring | Advanced Log Format Options, Runtime Statistics |
| Bug Fixes | HTTP Processing, SSL Handshake, Connection Stability |
How did HAProxy 1.4 improve load balancing algorithms?
HAProxy 1.4 introduced weighted load balancing algorithms, a significant step up from basic round-robin. You can
now use balance roundrobin with server weights and a new balance static-rr algorithm
for servers that don't support dynamic weight adjustments.
This matters because it lets you distribute load more intelligently across heterogeneous backend servers. In practice, you can assign higher weights to more powerful machines, making your infrastructure spending more efficient.
What are the key connection handling improvements?
The introduction of server-side keep-alive is the headline feature here. It allows HAProxy to reuse backend
connections instead of opening a new one for each client request. This is paired with new options like
http-server-close and http-tunnel for fine-grained control.
We also got native epoll support on Linux, which drastically improves performance under high connection loads. You'll see lower CPU usage and higher throughput, especially on modern Linux kernels.
How did SSL and health checking get better?
SSL support moved beyond basic termination. You can now use the ssl keyword on server lines to
encrypt backend connections, and health checks gained HTTPS support with the check-ssl option.
These changes mean you can secure entire data paths, not just frontend connections. Health checks for HTTPS backends finally work properly without hacks.
What new logging capabilities were added?
The logging system became much more flexible with new capture fields and variables. You can now log the backend
name, retries, connection times, and even SSL information using new format specifiers like %b,
%rc, and %sslc.
This level of detail is crucial for debugging complex routing issues and understanding exactly where time is spent in your request flow.
What core stability fixes should I know about?
Several critical bugs were squashed, particularly around HTTP processing and connection pooling. Fixes addressed issues with chunked encoding, header manipulation, and connection reuse that could previously cause stability problems under load.
The memory management was also improved with better buffer recycling and allocation patterns. You're less likely to see memory fragmentation issues in long-running processes.
FAQ
Does HAProxy 1.4 support SSL to the backend servers?
Yes, this was a major addition. You can
now add ssl to your server line to encrypt traffic between HAProxy and your backends, providing
full end-to-end encryption.
Can I use different weights for servers in round-robin?
Absolutely. The new
balance roundrobin algorithm supports server weights, allowing you to give more traffic to more
powerful backend instances.
How do server-side keep-alive connections work?
HAProxy can now maintain persistent
connections to backend servers and reuse them for multiple client requests. This reduces TCP overhead and
improves performance significantly.
What Linux kernel feature improves performance most?
Epoll support is the big one. If you're
running on Linux 2.6+, make sure to build HAProxy with USE_LINUX_EPOLL=1 for the best connection
handling performance.
Can I do sticky sessions based on a cookie value?
Yes, the new appsession
directive lets you implement persistence based on a specific cookie value, which is useful for application-based
session handling.