HAProxy – The Load Adjusting Tool

HAProxy – The Load Adjusting Tool

January 5, 2021 / Nirav Shah

HAProxy is a free, extremely quick and well-known toon offering high accessibility, load adjusting, and proxying for TCP and HTTP-based applications. It is especially appropriate for extremely high traffic sites and powers a lot of the world’s most visited ones. Through its consistent and overwhelming service, it has become the true standard open-source load balancer, is presently delivered with most standard Linux distributions.

Installation steps for centos8 server

Step 1

Update packages

$sudo yum update

Step 2

Install HAProxy

$sudo yum install haproxy


Step 3

An HAProxy essential setup advises the heap adjusting framework on what sort of associations it ought to tune in for and which workers it should hand-off the associations with.

Now we are going to create configuration file /etc/haproxy/haproxy.cfg

sudo nano /etc/haproxy/haproxy.cfg

And add the following text,

   log /dev/log local0
   log /dev/log local1 notice
   chroot /var/lib/haproxy
   stats socket /run/haproxy/admin.sock mode 660 level admin
    stats timeout 30s
    user haproxy
    group haproxy

     log global
     mode http
     option httplog
     option dontlognull
     timeout connect 5000
     timeout client 50000
     timeout server 50000

frontend http_front
     bind *:80
     stats uri /haproxy?stats
     default_backend http_back

backend http_back
     balance roundrobin
     server my_server private_IP:80 check
     server my_server private_IP:80 check

And save it using:wq!

Restart HAproxy using the command below

$sudo systemctl restart haproxy
$sudo systemctl enable haproxy

To learn more visit to the official HAProxy site: http://www.haproxy.org

Talk to AWS Certified Consultant

    Spread Love By Sharing:

    Let Us Talk About Your AWS Development Requirements

    Have queries about your AWS project ideas and concepts? Please drop in your project details to discuss with our AWS experts, professionals and consultants.

    • Swift Hiring and Onboarding
    • Experienced and Trained AWS Team
    • Quality Consulting and Programming
    Let’s Connect and Discuss Your Project