Reliable, high performance TCP/HTTP load balancer. See homepage at http://www.haproxy.org/.

HAProxy is a simple and fast load-balancer. For HTTP it works quite similar to 'pound' or Nginx. It can also load-balance plain TCP connections which enables it handle many more protocols like SSH, the Git protocol, SMTP, IMAP and many more.


HAProxy can simply be installed using pakfire. You will find the configuration files in /etc/haproxy.


You can find a very good and detailed configuration manual on the official HAProxy homepage at http://www.haproxy.org/#docs.

Example 1: SMTP Failover

This example will make HAProxy listen on port 25 and forward all connections to the first SMTP server (smtp01) until this is either offline or has more than 1000 connections opened. After that HAProxy will switch to the second one until a limit of 1000 concurrent connections is reached as well.

    log local2

    chroot      /var/lib/haproxy
    pidfile     /var/run/haproxy.pid
    maxconn     4000
    user        nobody
    group       nobody

    stats socket /var/lib/haproxy/stats

    log                     global
    option                  redispatch
    retries                 3
    timeout queue           1m
    timeout connect         10s
    timeout client          1m
    timeout server          1m
    timeout check           10s
    maxconn                 3000

listen smtp :25
    mode tcp
    option tcplog
    balance first

    server smtp01 check maxconn 1000
    server smtp02 check maxconn 1000
Edit Page ‐ Yes, you can edit!

Older Revisions • June 7 at 11:46 pm • Jon