Servage Magazine

Information about YOUR hosting company – where we give you a clear picture of what we think and do!

Load-balancing web applications

Thursday, June 1st, 2017 by Servage

network-serverLoad balancing works by distributing the traffic of a single website across multiple web servers. This is important for large websites that receive so much traffic that a single web server is no longer enough to serve all visitors. It also adds a layer of reliability because if one of the web servers goes down, the others can continue to serve visitors with little to no impact to the website. Let’s explore a couple of strategies for load balancing web applications.

DNS Load Balancing

This is probably the cheapest and simplest way to load balance web traffic. The Domain Name System (DNS) is not specifically built with load balancing in mind but system administrators can still use its built-in features as an advantage.

DNS load balancing works by setting up multiple A or CNAME records for a single domain name. For example, you can have both IP addresses 1.1.1.1 and 2.2.2.2 pointing to www.example.com. In a scenario like this, two servers with these IP addresses are serving the same website. If either of the servers goes down, browsers are smart enough to try the other IP address.

Software Load Balancing

Software load balancers are slightly more complicated but specifically designed for load balancing web traffic. This works by having a web server with suitable load balancing software, such as HAProxy or Nginx that redirects traffic to a group of web application servers. All requests arrive at the load balancer first, and then they are moved forward to an application server where the requests are processed by the website.

There are also companies who provide load balancing as a service. From a developer’s point of view, these could be considered software load balancers, although these companies may also be using hardware load balancers. These services allow developers to customize their load balancing setup using a dashboard of the service provider. It is for example possible to redirect all traffic on port 3306 to a group of IP addresses that are running a MySQL cluster.

Hardware Load Balancing

Hardware load balancers are even more complicated to set up. They are also usually rather expensive. However, hardware load balancers have certain benefits over software load balancers. For example, they have their own CPUs to process traffic, which means actual servers don’t have to spend their processing power for load balancing.

Other than having dedicated hardware, these type of load balancers work similarly to software load balancers. They are the first devices to receive web traffic, and they redirect it forward to actual application servers. Hardware load balancers work like a router in a typical home with the exception that the traffic is sent to a different server every time. Hardware load balancers are generally used for websites with a significant amount of traffic due to the related complexity and cost.

Load-balancing web applications, 5.0 out of 5 based on 1 rating
Categories: Tips & Tricks

Keywords:

You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

No comments yet (leave a comment)

You are welcome to initiate a conversation about this blog entry.

Leave a comment

You must be logged in to post a comment.