Sunteți pe pagina 1din 4

A Complete Guide to Understand the Concept of Load Balancing

What is Load Balancing?


Load Balancing refers to the efficient distribution of incoming network traffic across a group of backend
servers to implement failoverthe continuation of a service after the failure of one or more of its
components. The benefits of load balancing include optimum utilization of resources, maximum
throughput; minimize response time, and avoidance the overloading of any single server. It is worth to
mention that the load balancing is the main reason behind the server clustering.

The load balancing can be implemented with dedicated load balancing hardware, software or a
combination of both. To achieve maximum reliability and high availability, a dedicated load balancing
hardware or software is generally connected to multiple components which are monitored
continuously. The main objective behind connecting multiple components rather than a single
component is to achieve high reliability and availability through redundancy.

When a component becomes non-responsive, the load balance detects it automatically and stops
sending traffic to it until that component comes back online. To make this work, there must be at least
one component in excess of the services capacity (N+1 redundancy). This approach is more cost-
effective and flexible than the failover approach where each single live component is paired with a
single backup component that takes over when a failure occurs, (dual modular redundancy).

What Are The Different Types Of Load Balancing?


To understand different types of load balancing in a better way, lets first understand how a web
application environment will work when there is no load balancing.

So, What Will Happen If There Is No Load Balancing?


In the absence of load balancing, the users will connect directly to your web server, which can go down
if a large number of users star sending a huge amount of queries simultaneously beyond its handling
capacity. In this case, the users may have a slow experience or they may not be able to connect to your
web server at all. The load balancer is used to avoid both of these situations.

There are mainly two types of load balancing methods.

Layer 4 (Transport Layer) Load Balancing


Layer 7 Load Balancing

Layer 4 (Transport Layer) Load Balancing


The layer 4 (transport layer) load balancing is the simplest way to balance network traffic load to
multiple web servers. When this method of load balancing is in place, the load balancer will forward the
user request to a web-backend group of backend servers on the basis of IP range and port. It means that
if a user sends a request for http://www.abc.com/xyz, the load balancer will forward the traffic to a
backend web server that handles all the requests for http://www.abc.com on port 80. Generally, all
servers in the backend should serve identical content to prevent users from receiving inconsistent
content. All web servers in the backend are connected to the same database server.

Layer 7 (Application Layer) Load Balancing

When the Layer 7 (Application Layer) Load Balancing is in place, the load balancer will forward the user
request to a to a web-backend group of backend servers on the basis of the content requested by the
user. This load balancing method allows you to run multiple web application servers under the same
domain and port. For example, if a user requests http://www.abc.com/bog, the load balancer will
forward the user request to the blog backend, which is a group of backend servers that run your blog
connected. The other user request will be forwarded to web-backend servers which run another
application. It is worth to mention that all backend are connected to the same database server.

Which Is The Most Popular Free And Open Source Load Balancer?
HAproxy, which stands for High Availability Proxy, is the most popular free and open source load
balancer software that offers a high availability load balancer and a proxy server for TCP and Http-based
applications that distribute user requests across multiple backend servers.

Why HAproxy Is So Popular?


The main reason behind the immense popularity of HAproxy is that it has a reputation for being fast and
efficient in terms of processor and memory usage. Thats why; the HAproxy is used by a number of very
high traffic websites like GitHub, Bitbucket, Stack Overflow, Reddit, Speedtest.net, Tumblr, Twitter and
Tuenti. It is also used in the OpsWorks product from Amazon Web Services.

What Is The Latest Stable Version Of HAproxy And How Can You Download It?
HAproxy 1.7.8 (released on 2017/07/07) is the latest stable version of HAproxy load balancer software.
To download this version, visit the following link: http://www.haproxy.org/#down

What Are The Supported OS/Platforms For HAproxy Load Balancer Software?
The support OS/Platforms for HAProxy Load balancer Software are as follows.

Linux 2.4 on x86, x86_64, Alpha, Sparc, MIPS, PARISC


Linux 2.6 / 3.x on x86, x86_64, ARM, Sparc, PPC64
Solaris 8/9 on UltraSPARC 2 and 3
Solaris 10 on Opteron and UltraSPARC
FreeBSD 4.10 - 10 on x86
OpenBSD 3.1 to -current on i386, amd64, macppc, alpha, sparc64 and VAX (check the ports)
AIX 5.1 - 5.3 on Power architecture

What Are The Common Load Balancing Algorithms Used By HAproxy?


The HAproxy load balancer software uses a number of algorithms to determine which backend serve will
be chosen for load balancing. Besides using the algorithms, it can also assign a weight parameter to
manipulate how often a server is chosen compared to other servers.

Here is a list of common Load Balancing Algorithms used by HAproxy load balancing software:

Roundrobin: Roundrobin is a default algorithm that chooses servers in turns.


Leastconn: Leastconn algorithm chooses the server having the least number of connections. It is
recommended for longer sessions. When Leastconn is used for load balancing, servers in the
same backend are also rotated in round-robin fashion.
Source: Source algorithm decides which server should be used on the basis of a hash of the
source IP, that is, the IP address of your users. Source algorithm ensures that a user will connect
to the same server.
Sticky Sessions: Sticky Sessions algorithm is used to ensure that a user continues to connect to
the same backend server by using appsession parameter in the backend that needs it.
Health Check: Health checks algorithm determines whether a backend server is available to
process requests in order to avoid manual removal of a server from the backend if it becomes
unavailable. The algorithm tries to establish a TCP connection to the server to check whether
the backend server is listening on the configured IP address and port. When a server fails a
health check, it becomes unable to serve user request, hence, it is automatically disabled in the
backend by Haproxy load balancing software and no traffic is forwarded to it until it becomes
healthy again. In case, all backend servers fail, the HAproxy load balancer will stop the service
until at least one of those backend severs becomes healthy again. It is worth to mention that in
certain cases like database servers, the default health check algorithm is not sufficient to
determine whether a server is still healthy.

What Are The Alternatives Of HAproxy Load Balancer?


The two best alternatives of HAproxy load balancing software are as follows.

Linux Virtual Servers (LVS): Official Website: http://www.linuxvirtualserver.org/


Nginx: Official Website: https://nginx.org/ and https://www.nginx.com/

Need Help In HAproxy Load Balancing Configuration?


If you need any kind of assistance in Haproxy Load Balancing Configuration, look no further than
Haproxy Load Balancing Solutions of Infinitive Host Technologies. We provide fast, reliable and cost-
effective HAproxy load balancing solutions for High Availability Applications. To hire our experts for
HAproxy Load Balancing Configuration, call us at 0141-4914714 today!

You can also email us at sales@infinitivehost.com or contact us through our Skype ID: vkare-it. To know
more about our HAproxy load balancing solutions, visit our website
https://www.infinitivehost.com/haproxy-load-balancing

S-ar putea să vă placă și