HAproxy or High Availability proxy is an open source load balancer, which can load balance any TCP service. HAProxy (High Availability Proxy) is a TCP/HTTP stack balancer and intermediary server that permits a web server to spread approaching solicitations over various endpoints. This is valuable in situations where excessively numerous simultaneous associations over-immerse the capacity of a solitary server.

Characteristics

  • Free
  • Veryfast
  • Reliable solution which offers load balancing.
  • High availability.
  • Proxying for TCP and HTTP based applications.
  • It is most suitable for high traffic websites and powers many of the world’s most visited websites.

Installation steps

apt-get install haproxy

haproxy -v

/etc/default/haproxy set ENABLED = 1

service haproxy <reload restart start status stop>

Setup

Create a setup in which we host two web servers and one HAProxy instance.

Now you open up the web browser and browser through haproxy IP and keep refreshing the tab. When you refresh each time, the load will get distributed to each web server.

HAProxy supports many algorithms. They are as of below:

  • Roundrobin
  • Static roundrobin
  • Least connections
  • Source
  • URI
  • URL

Difference between ELB and HAProxy

  • ELB can handle only less number of concurrent connections when compared with HAProxy.
  • HAProxy does not support SSL out of the box. ELB has SSL support, SSL offload or SSL termination.
  • Algorithm options are available for HAProxy whereas ELB supports only Roundrobin.
  • HAProxy does not support geo-location out of the box. AWS ELB by itself cannot support geo-location but in conjuction with AWS Route53 DNS.
  • AWS ELB is supported by the monitoring tool Cloudwatch. HAProxy is supported by Nagios.

[tagline_box backgroundcolor=”description=” shadow=”no” shadowopacity=”0.7″ border=”1px” bordercolor=”” highlightposition=”top” content_alignment=”left” link=”” linktarget=”_self” modal=”” button_size=”” button_shape=”” button_type=”” buttoncolor=”” button=”” title=”” description=”If you have any queries on HAproxy versus ELB feel free to leave us a message and our representative will get back to you.

” margin_top=”50px” margin_bottom=”” animation_type=”slide” animation_direction=”left” animation_speed=”0.3″ class=”” id=””]

    [/tagline_box]