Comments on Web Server Load-Balancing with HAProxy on Ubuntu 14.04

HAProxy(High Availability Proxy) is an open-source load-balancer which can load balance any TCP service. HAProxy is a free, very fast and reliable solution that offers load-balancing, high-availability, and proxying for TCP and HTTP-based applications. It is particularly well suited for very high traffic web sites and powers many of the world's most visited ones.

17 Comment(s)

Add comment

Please register in our forum first to comment.

Comments

By: Chono

Great tutorial, I was thinking about it for some time.. Is that HAproxy has to be installed on extra VirtualBox instance or can it run on one of the Web Server?

Thanks

By: Ildefonso

Can this be used as a load balancer for ADSL modems?

I have three ADSL modems with a very bad service from my ISP (mainly due to the distance from the telco's central to my office) and over twenty PCs. I wish I could use something similar in order to send my PCs outbond internet trafic to  the ADSLs, in a way that does not saturate the bandwidth of the single modem we are currently using. I have a Linux bot that works as a router and gateway, connected to a single modem.

Any advice would be much appreciated.

By: Sanchit Jain Rasiya

I am not sure of if it can be used for ADSL load balancing. By the way, how many broadband lines do you have? If you 3 lines, you can configure your Linux Box as a load balancer. Check out- http://unix.stackexchange.com/questions/138956/implementing-load-balancing-on-any-linux-distro

You can also have a look at this device- http://www.amazon.com/TP-LINK-TL-R470T-Broadband-Changeable-Ethernet/dp/B005SYQBN8/ref=sr_1_22?s=pc&ie=UTF8&qid=1427375224&sr=1-22&keywords=load+balancer

Hope it helps!

By: Sanchit Jain Rasiya

Thanks Chono. Not necessarily on VM. But it would be strongly suggested to have it separate on production so that it is independent of any host. If the host with both services is down, it will be a problematic situation.

By: Ildefonso

Thanks Sanchit

I have not three, but four broadband lines, so I will be trying your suggestion as of next weekend.

Regards

By: hipr

I am now wondering, how to set up an htts and SSL cetrificate, i.e. where goes what and how to configure it...

By: Zeru

I'm using similar configuration as in the above but I can't get a reply for high connection rates. For instance, for --rate 500 and num_conn 10, that is, when the number of reuest greater than 5000, the haproxy has no min, avg, and max reply rate.

Thanks,

By: LandonC

Thanks -- works like a charm for Solr load-balancing with SolrCloud and ZooKeeper.

By: Tom Dings

Used this basic explanation to balance 64 web servers, and 128 mysql database machines. Works out very well.

By: Sanchit Jain Rasiya

Wow, great to know. Thanks!

By: Anthony

I've managed to start up HAProxy successfully. But when I try to access my VIP, I got this error "503, Service Unavailable"

i am am sure that both my web server is up. I am able to access directly using the web server IP.  The default web location is /var/www/html/index.html, where should I change the directory to point to the correct one?

Appreciate your advice.

 

thank you,

By: shreedhar

nice tutorial. Very crisp and clear !!!

By: Sanchit Jain Rasiya

Thanks!

By: kishore

I have a three web servers in which haproxy is running to balance the load.I'm using Ubuntu, so one of my web servers showing major difference in bandwidth usage and rest two are showing almost equally bandwidth usage. I have used the Round-robin algo in haproxy config.So how to equally divide the bandwidth usage. Please suggest asap

By: VuPhan

great tut!

By: Santoso

Great Tutorial! But now I'm wondering if the load balancer is down, so what happens to the web server? Thanks alot.

By: Bhawani Singh Shekhawat

Great tutorial :)