HAProxy is a open source, very fast and reliable solution offering high availability, load balancing, and proxying for TCP and HTTP-based applications. It is particularly suited for web sites crawling under very high loads while needing persistence or Layer7 processing.

learn more… | top users | synonyms

26
votes
3answers
14k views

How can I remove balanced node from haproxy via command line?

I have haproxy running as my load-balancer and from the stats web interface that comes with haproxy, I can put a web server into maintenance mode (and bring it back out again) - which is great! ...
18
votes
3answers
11k views

Ordering: 1. nginx 2. varnish 3. haproxy 4. webserver?

I've seen people recommend combining all of these in a flow, but they seem to have lots of overlapping features so I'd like to dig in to why you might want to pass through 3 different programs before ...
18
votes
3answers
7k views

How can I deploy a scalable, reliable haproxy cluster on Amazon EC2?

We need some more advanced functionality than ELB provides (mostly L7 inspection), but it's not obvious how to handle things like heartbeat and high availability with something like haproxy using EC2. ...
16
votes
7answers
26k views

How can I use HAproxy with SSL and get X-Forwarded-For headers AND tell PHP that SSL is in use?

I have the following setup: (internet) ---> [ pfSense Box ] /-> [ Apache / PHP server ] [running HAproxy] --+--> [ Apache / PHP server ] ...
14
votes
1answer
29k views

How to set up stats for HAProxy?

I can't figure out how to set up stats for HAProxy. This is my configuration: global log 127.0.0.1 local0 log 127.0.0.1 local1 notice daemon #debug user haproxy group haproxy ...
14
votes
7answers
19k views

Remote IP's with HAProxy

I'm testing a new web server setup which is having a couple of issues. Essentially, we have a web server, where the code uses the remote IP for some interesting things, and also some apache ...
13
votes
3answers
10k views

When using TCP load balancing with HAProxy, does all outbound traffic flow through the LB?

I am setting up an app to be hosted using VMs(probably amazon, but that is not set in stone) which will require both HTTP load balancing and load balancing a large number(50k or so if possible) of ...
13
votes
2answers
8k views

LVS vs HAProxy, which should I choose?

I am looking for a solution to load balancing and failover strategy, mainly for big web applications. We have many services to be balanced, such as web, MySQL, and many other HTTP or TCP based ...
13
votes
2answers
9k views

How to keep haproxy log messages out of /var/log/syslog

I set up haproxy logging via rsyslogd using the tips from this article, and everything seems to be working fine. The log files get the log messages. However, every log message from haproxy also shows ...
12
votes
2answers
6k views

Do HTTP reverse proxies typically enable HTTP Keep-Alive on the client side of the proxied connection and not on the server side?

HAProxy has the ability to enable HTTP keep-alive on the client side (client <-> HAProxy) but disable it on the server side (HAProxy <-> server). Some of our clients connect to our web service ...
12
votes
1answer
623 views

By what criteria do you tune timeouts in HA Proxy config?

When configuring HA Proxy, how do you decide what values to assign to the timeouts? I've read a half dozen samples in various blogs, and everyone uses different timeouts and no one discusses why. ...
12
votes
2answers
6k views

How to Read the haproxy Stats Page

For those of you using HAProxy along with the stats papge (haproxy?stats), how do I interpret this page? There is no decent explanation. For instance: Which Session column displays the number of ...
11
votes
4answers
10k views

Windows replacement for HAProxy

It does not appear that there is a similar question to this already posted, so I will go ahead and ask. I am working on a project that could benefit from having two - four servers handling incoming ...
11
votes
1answer
459 views

haproxy: retain existing sessions under high load, serve '503' to new arrivals

Trying to do what it says in the title: retain existing sessions under high load, and serve 503-message to newly arrived visitors. Problem: it works, but the sessions don't last beyond about 90 ...
10
votes
2answers
9k views

How to divert traffic based on hostname using HAProxy?

I've had some initial success with HAProxy setting up a bunch of app servers listening on various other ports. I now have another webserver listening on one port, and i'd like to what changes to make ...
10
votes
5answers
7k views

Installing HAProxy on CentOS 6.3?

This is a weird one. I've installed the EPEL for CentOS 6 via # rpm -Uvh http://dl.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-8.noarch.rpm The tried to install HAProxy: # yum update # yum ...
10
votes
3answers
8k views

Possible to add basic HTTP access authentication via HAProxy?

I've successfully setup HAProxy in front of an HTTP server which I have no control over. Is it possible to configure HAProxy to add Simple HTTP Authentication to all sites, bearing in mind I can't ...
9
votes
3answers
5k views

Dead gateway detection on Windows 2008 Server

We have recently implemented HAProxy for stackoverflow.com. We decided on using TProxy to maintain the source address for clients connecting so our logs and other IIS modules which depend on the ...
9
votes
4answers
2k views

Advantages of Using Nginx or HA Proxy as Load Balancer

In our environment we us both Nginx and HA Proxy on different clusters. Are there advantages of using one over the other? Or, what is the best way to go about load balancing a basic LAMP server ...
8
votes
4answers
5k views

haproxy + stunnel + keep-alive?

I'd like to put stunnel in front of haproxy 1.4 to handle HTTPS traffic. I also need stunnel to add the X-Forwarded-For header. This can be achieved by the "stunnel-4.xx-xforwarded-for.diff" patches ...
8
votes
1answer
6k views

How to block IP addresses in HAProxy?

Is there something like Apache "deny from ip" in haproxy?
8
votes
2answers
3k views

Is there a way to add more backend server to haproxy without restarting haproxy?

We want to be able to add more backend servers on demand. Right now I don't see a way to add more backend servers to the config file without restarting haproxy.
8
votes
6answers
5k views

Best way to load balance across multiple static file servers for even an bandwidth distribution?

First off, I'll explain my situation to you. I'm running a fairly popular website as a side project, so I can't really invest a ton of money into it. I currently have just one server with HAProxy in ...
8
votes
1answer
2k views

Poor load balancer performance on rackspace and centos

I am load testing different options for load balancing, and am getting poor results from Nginx, haproxy, and varnish. I have one 4GB load balancer at Rackspace, hitting 4x1GB app servers. I'm ...
8
votes
1answer
195 views

Set header key based on SSL ID

Is there a way to set a header key based on SSL ID value with HAProxy 1.5? We would like to use the SSL ID as the session ID for clients who do not support cookies.
7
votes
2answers
4k views

Is there a way to configure HAProxy to send traffic based on a cookie?

When configuring HAProxy, I would like to send traffic to certain servers based on the cookie. Example, there is the HAProxy server, and 2 web servers (serverA and serverB) When someone logs in, a ...
7
votes
2answers
2k views

HAProxy SSL Farm Options

I am trying to figure out how to set up an SSL farm with haproxy and SSL reverse proxies and I am looking for some general advice: Is it possible to meet all of the following: Load balance requests ...
6
votes
6answers
2k views

why no examples of horizontally scalable software load balancers balancing ssl?

I have a bunch of questions with respect to ssl, local sessions, and load balancing which seem to be interconnected, so I apologize in advance for the length of this question. I have a website which ...
6
votes
3answers
6k views

HOWTO use haproxy custom 503 error document when back server sends 503 http code

I would like haproxy to use its own 503 document page when back server (backend) sends HTTP 503 code. Is it possible? Have seen something like "monitor fail" conditions but don't know how to add it ...
6
votes
1answer
4k views

hardware recommendations for HAProxy for a small or medium traffic site

I am interested in setting up HAProxy for use as a load balancer for a set of small traffic web applications. The use is growing and might become medium sized in the near term (6 months or so). Mainly ...
6
votes
1answer
2k views

Load balancing MySQL using HAProxy: Got an error reading communication packets?

I've set up load balancing MySQL slaves using HAProxy via a xinetd. 2 load balancers shared a virtual IP that is managed by Pacemaker: crm configure show: node SVR120-27148.localdomain node ...
6
votes
1answer
3k views

Pacemaker Active/Active haproxy load balancing

I am using Haproxy to load balance replicated mysql master servers. I am also using Heartbeat and Pacemaker for Active/Active ip failover with two virtual ips on the two load balancers for web server ...
5
votes
2answers
9k views

How to setup HAProxy with failover?

I understand that, to get failover on an HAProxy load balancing setup, you need two machines running HAproxy (and route it to several webserver instances). But in this case, say abcd.com, how do we ...
5
votes
2answers
8k views

Need HAproxy + Varnish + nginx setup suggestions

Currently, I have two load balancers running HAProxy, which forward requests to backends, each of which run Varnish cache in front of nginx. I thought this would distribute most the bandwidth across ...
5
votes
4answers
4k views

What are the Differences between HAProxy and Ngnix in reverse proxy mode?

What are the differences between HAProxy and Nginx when it comes to their abilities as a reverse proxy?
5
votes
2answers
4k views

Overriding the X-Forwarded-For header in haproxy?

In my HAProxy load balancer, I have the following config chunks: defaults mode http log global option httplog clf option ...
5
votes
4answers
2k views

Mitigate DDoS attack with HAProxy [duplicate]

We were targeted earlier today by a DDoS attack. There was 20x as many connections as normal on our load balancer (HAProxy), and all the backend nodes continued to go down during this attack. System ...
5
votes
2answers
151 views

Heartbeat Aware Load balancing

I am using Haproxy for load balance my web servers. Not all of them has same resources. Typical loadbalancing algorithms caused some low end servers to overload as LB isn't hearbeat aware. Is the a ...
5
votes
2answers
840 views

How to handle 20k concurrent persistent connections

I'm trying to design an architecture to handle massive TCP socket connections and I'm in doubt on the limits of this architecture. I'll have to handle ~20k concurrent TCP connections and these are ...
5
votes
1answer
2k views

Haproxy load balancing with HTTP Headers

We're using HAProxy to load balance our websocket and comet application. There is one HAProxy and 3 applications running in the back. We use HTTP Basic Auth (and we will use other types of auth in ...
5
votes
1answer
5k views

HAProxy health checks: using httpchk and observe?

I'm using HAProxy 1.4.18 with the following backend configuration backend staging option httpchk HEAD /check.txt HTTP/1.0 http-check disable-on-404 default-server error-limit 1 on-error ...
5
votes
3answers
2k views

High Availability for SSL Web Site

One of our web server clusters serves a moderate number of busy e-commerce applications. At present, each site lives on a specific web server and has a hot-spare copy mirrored to another web server ...
5
votes
2answers
176 views

HAProxy not balancing server load fairly

HAProxy doesn't seem to keep the connections to the servers balanced. Keep this in mind: using HAProxy v1.3.26 5 equally balanced server specs algorithm is round robin, but no weights are applied ...
5
votes
1answer
754 views

Is it possible to use one haproxy process to load-balance more than one protocol/port?

I've got haproxy to work for us. But right now there are two haproxy processes running. One for HTTP and the other for TCP (RTMP). I've tried to configure both proxies in one configuration file but ...
4
votes
2answers
421 views

When you exhaust a 1 Gpbs connection to your main haproxy, how do you scale out?

If you exhaust your public network connection (say 1 Gbps) to your haproxy server that proxies requests to your backend servers, what options do you have to scale it out? Since all request traffic ...
4
votes
4answers
5k views

Haproxy mysql failover load balancing

I have setup mysql master-master replication and now I am trying to load balance mysql servers with Haproxy. Load balancer: 192.168.1.5 mysql1: 192.168.1.7 mysql2: 192.168.1.8 The below haproxy ...
4
votes
1answer
6k views

HAProxy - forward to a different web server based on URI

I have an HTTP farm with the following configuration: listen webfarm 10.254.23.225:80 mode http balance roundrobin cookie SERVERID insert option httpclose option ...
4
votes
5answers
1k views

HAProxy and “sharding”

I am cross posting this from stack overflow since it was suggested I might get a better answer here ... I was wondering if anyone has used HAProxy for sharding. Specifically, I would like to be able ...
4
votes
2answers
107 views

How to get name of server that has served request in fronted section?

I need to add server name in response HTTP headers X-Servedby. Is there any way to replace [server] with name of server that has served request? frontend front x.x.x.x:80 default_backend balancing ...
4
votes
2answers
1k views

Is there a Windows equivalent of the HAProxy for virtual load balancing?

I want to load balance a bunch of VMs, but don't have any Linux boxes available. Typically, afaik, it's done with HAProxy on Linux. Is there an HAProxy equivalent on Windows? (free, open-source if ...