Web sites actually have a problem when they become popular: how to scale as their visitor numbers scale into the thousands and even millions. While pure raw horsepower is certainly one of the major reasons for building your infrastructure, another big reason is redundancy. After all, as those visitor numbers tick up, the stakes get that much bigger.
These two areas are where DNS load balancing comes into play.
Picture this: your web traffic flows into the load balancer which sits in front of your web servers. Thanks to its configuration, the load balancer will know the following:
- All the web servers in your infrastructure
- The health of all of your web servers based on automatic health checks
- Which web servers serve certain geographic regions
- The percentage of total traffic that web server should receive
- For DNS based load balancers, the TTL for how long the DNS record is cached for
From all of this information, the load balancer builds its load balancing pools for the various geographic regions, so it knows exactly which web servers are available for traffic and how often they should receive traffic.
As web traffic hits the load balancer, it starts handing off traffic to each web server that is next up in its distribution list based off of all of these settings. This means if there are four web servers (each with equal weights and all in a health state), each web server gets 1/4th or 25% of the web traffic. Another example is a web server that receives 50% of the traffic, while the remaining three web servers split the remaining 50% evenly.
What happens if a web server has an issue?
Each web server is checked at a predetermined interval via a health check to ensure it is in a healthy state. If the health check fails and certain criteria are met (such as two out of three health checks failing), then the load balancer puts that web server in failover mode and removes it from the load balancing pool.
Let’s take it one step further using a Global Server Load Balancing (GSLB) solution such as DynECT Managed DNS’s Traffic Management service. By determining the geographic location a request is coming from, the load balancer essentially creates separate load balancing pools for each geographic location.
Why is geographic based load balancing important?
It allows you to take the advantage of your own geographically dispersed infrastructure and vastly increase the performance by shortening the distance between your customers and your data centers. The load balancer is intelligent enough to know that if a query comes from the West Coast of the United States, respond back with a different response compared to if a request is coming from the East Coast of the United States. Or, perhaps you want to target your EMEA customers so they go to your European based datacenter.
In the end, load balancing enables your web infrastructure to scale as your business grows, giving you the tools to increase your site’s performance, redundancy, and flexibility. While load balancing does add in costs and complexity, the benefits far outweigh the negatives.