DNS Load Balancing – Comparison of 4 services
June 6, 2014 | Dmitriy Akulov
What is DNS load balancing?
DNS load balancing reroutes live traffic based on data and other specified parameters.
For example, you have a very popular and heavily-trafficked website. To prevent overloading your servers with hits, traffic can be routed to other servers based on their location, server availability and performance.
A user’s browser will attempt to resolve the hostname to an IP address, as it does usually, but will be sent to a server that’s close to them and that will be able to serve their information with little latency.This process is completely transparent to the user.
In most cases, HTTP load balancers offer greater flexibility, but are a single point of failure. If your HTTP load balancer goes down, your website will be inaccessible even if your web servers are up.
Of course, DNS servers go down as well, but they don’t have to deal with the same loads as HTTP load balancers. Its easier and cheaper to set up multiple instances of name servers in different locations. Although Anycast has greater reliability in terms of uptime, it’s much more complex to manage and offers much less flexibility.
Can I do it myself?
Creating your own DNS load balancing system is an option.
The easiest method I’ve found is using a Bind9+GeoIP patch. It offers geo load balancing for continents, countries, cities, ASNs and other criteria.
However, this system is much more difficult to implement and manage. There is no easy-to-use graphic user interface. Everything has to be done via a command line or coded to your needs.
Ready-made DNS load balancing services
Web service companies are now offering DNS load balancing services. Each of their solutions have different features with their own web control panels as well as APIs to make your job easier.
I chose four DNS load balancing services and reviewed the pros and cons of each of them.
Cedexis’ solution focuses on performance-based load balancing. It gathers its own data — availability, HTTP connect time and throughput — on multiple CDNs, cloud services and data centers. (In a previous article about jsDelivr, I’ve discussed how this service works. If you haven’t read it yet, it’s something you should review when you have a chance.)
The data is used by Cedexis’ users to create their own load balancing applications. (Benchmarks can also be set to private and will only be available to you.) DNS load balancing algorithms or “DNS Applications” as Cedexis calls them, can be created instantly using one of their predefined basic algorithms or your own custom code.
All DNS applications are written in PHP, giving you the flexibility to create your own load balancing algorithms. Additionally, there’s the option to use external data to calculate the optimal path for each user to take.
Using this load balancing system, users can be routed based on the best path (unless we enable geo load balancing). Server load can also be taken into account to ensure users are optimally distributed.
There’s also the option to prevent cloud servers and CDNs from distributing content when they reach pre-defined bandwidth limits to avoid overages, which means real savings for those looking to control their costs.
Users, of course, will not access a server that’s not available. This load balancer includes uptime monitoring and server monitoring (except from user-gathered data). This can be used in your applications for failover features.
That’s the beauty of using PHP rather than other rules-based load balancing systems — you are free to create custom and optimized solutions that fits your needs.
Cedexis also does not host your name servers. It creates a CNAME, which you point to your domains. You don’t have to change anything to switch to their service.
Cedexis DNS servers are backed up by a distributed Anycast network with 48 locations globally.
DNS Application management screen.
Configuration screen for a private benchmark
- PHP-based scripts allows highly customizable solutions
- Ready-to-use data for the most popular providers
- Create your own custom platforms tests
- External data can be used
- Usage charts and performance visualization
- Use your own name servers
- More than just geo load balancing
- Geo load balancing does not include US states; countries are the smallest accessible regions
- Creating custom algorithms can be difficult for those with no developer experience
- Debugging can be tricky
Dyn Traffic Director
As you’ve guessed, this is the product of Dyn — a company that specializes in DNS services. They offer personal to enterprise DNS hosting, email delivery and, of course, DNS load balancing products.
Traffic Director is one of their load balancing products. It features geo-based load balancing with integrated uptime monitoring and failover service.
Geo load balancing is very helpful. Users are served from the nearest location to optimize speed, performance and to minimize lag time. Using these tools, you can build a basic CDN service for your own website.
Dyn owns a global Anycast network that offers fast and reliable DNS service. If any of the locations goes down, clients and users will not notice the outage.
Traffic Director allows you to load balance your users using DNS, based on their location through a recursive IP lookup and a predefined set of rules. It includes an integrated cascading failover system that, in case of downtime, will ensure your users are passed on to a working server.
Some of its features includes:
- Geo load balancing based on continents, countries and states (for the USA) and provinces (for Canada)
- Advanced settings for response records, including serving modes, TTL, weight and others
- A failover system that allows an unlimited number of hosts to be served in the event of a downtime
- Å monitoring system with HTTP/S, Ping, SMTP, TCP support and different options for each, such as expected data for each HTTP response.
- Detailed email notifications
Main LB configuration screen.
- Detailed uptime monitoring
- Multiple failover features are available for rules settings
- Rules can specify large and small geographical areas (including American states and Canadian provinces)
- Weight- and geo-based load balancing
- Intuitive control panel
- Limited to geo- and weight-based load balancing
Rage4 is a new company that offers extremely competitive DNS load balancing services with flexible pay-as-you-go pricing.
One of its most interesting features is the ability to set and use coordinates. The locations for servers can be set for each geo load balance record. Using Rage4’s “First closest server” mode, users should be able to automate geo load balancing without the need to set up custom rules for each country.
That being said there are bugs in its implementation. When multiple records are geographically close to each other, it results in incorrect data. But I am sure in time all issues will be resolved.
The standard geo load balancing mode (which allows the creation of static rules) offers limited options. All countries are broken into larger groups called “Geo Regions” that are easier to manage and create rules for, but limits users that need to load balance individual countries. For example Greece is grouped with 15 other countries as part of the “Southern Europe” Geo Region.
But the USA and Canada have their own Geo Regions within their countries. Canada is divided in West and East and USA in 10 different regions, such as Region X including Alaska, Idaho, Oregon, Washington.This implementation is of more use than breaking them down by states or provence, in my opinion.
Monitoring and failover are integrated into an API, UptimeRobot. You will have to register with it and create the checks. Using the API key and webhooks, it will be ready for full integration. If UptimeRobot registers downtime with any of your servers, Rage4 will be notified and will automatically switch the DNS record to a predefined failover value. The response time to a downtime is of course limited by the frequency of checks by UptimeRobot.
Another excellent feature is Vanity DNS. You don’t have to use their predefined name server (ns1.r4ns.com). You’re able to create your own (ns1.mycdn.com) and point them to their Anycast IP addresses. It allows the white labeling of your service, and no one needs to know you are using Rage4.
Rage4 DNS servers are backed up by a distributed Anycast network with 30-plus locations around the world. A full network map is also available.
Manage your DNS records
Edit an A record
- Pay-per-use pricing
- A free option is available
- Use coordinates to automate your geo load balancing
- Limited documentation
- Coordinates are buggy (for now)
- Limited failover features compared to the competition
Launched in 2007, Edge Director is popular among web administrators. At first glance, the web design is dated, but this is one of those cases when you shouldn’t judge a book by its cover.
The control panel is also difficult to understand, especially if you are used to the newer designs of other companies and AWS. But its manuals are solid and goes a long way to help users understand how it works.
Edge Director offers both geo load balancing and monitoring/failover services. Their implementation of geo targeting is unique. You can filter by the RIR that administers the user’s IP address, by country and cities. You’ll be able to target a US-based user by setting a specific IP address for all ARIN users or get even more specific and target users by setting an IP for United States or for example an IP for Washington DC.
This actually is the only service in this post that allows you to target cities. But in case of the US, I would still much prefer the “Geo Regions” offered by Rage4.
For each of your records you can also assign a “health monitor” that will check uptime every 60 seconds. The monitors are very detailed and allow testing based on multiple protocols including icmp, http, ftp, smtp and others.
Manage DNS records for a domain
Geo load balancing configuration
- City-level IP filtering
- Detailed health monitoring for records
- HTTP redirection
- Pay-per-usage pricing
- Non-intuitive design
NSONE is a newer company that offers some advanced DNS load balancing services and their main feature is the “Data driven” decisions.
Basically you can do load balancing based on lots of different parameters including:
- Infrastructure status and architecture
- Current system load
- Current active connections/requests
- Compute or CDN commits
- Geo data
- Coarse regions
- Network details
- IP prefixes
- AS numbers
The data can come from a variety of “Data Feeds”, including external services, NSONE’s built in monitoring, or your own tools through their API:
- Custom data (via NSONE API)
- NSONE monitoring
- Rackspace cloud monitoring
- AWS CloudWatch
The logic is built on top of “Filters”. All possible answers to a DNS request are passed through the filters that the user has set. These filters can perform basic tasks on the answers such as removing and ordering them based on upness, weights, or priorities, and even more complicated intelligent decisions based on the metadata provided, like automatic load shedding, geo- and network-based fencing, and so on.
You can combine as many filters as you want and attach to them any amount of metadata to achieve the exact results you want. This is very customizable system and its also fairly easy to manage as it does not require any programming knowledge.
Now to feed your filters with metadata you need to setup some data feeds. I already listed all the supported ones above. You can use the uptime data from Pingdom/Monitis or NSONE’s monitoring to create an effective failover system.
Finally using NSONE’s API you can stream your own custom data from private monitoring tools, like server load, network stability, remaining bandwidth, or whatever else is relevant to your application, and the data will be used by NSONE’s filters for real-time traffic routing.
16 locations around the globe using anycast.
Managing a domain
- Use own custom data to adjust routing in real time
- Good uptime monitoring options
- Very customizable
- Easy to use
- Includes a free package
- Learning curve to take advantage of the more advanced features
Let’s test the performance of the DNS servers of each company. Load balancing is important, but if it impacts the time it takes to resolve a DNS entry, its use needs to be reconsidered.
To measure performance. I ran the following command (dig hostedDomain.com @dns1.service.com) multiple times for each company’s name server and noted the average result from different locations.
In the case of Cedexis, I created 2 tests: a production PHP load balancing code for jsDelivr.com (with complicated algorithms) and basic geo load balancing (similar to the other services).
For comparison, I also added CloudFlare DNS because of its popularity.
Dyn Traffic Director looks like has the fastest DNS servers. It’s not a surprise, considering its years of experience in DNS services. In second place is CloudFlare, but since there’s no calculations before responding it doesn’t mean much for our purposes.
It’s also interesting how advanced the Cedexis algorithm compares to basic load balancing. PHP compilation does have impact on DNS response times, although very small one.
I hope this small review will help some people build their applications and websites using load balancing for better performance and uptime.