Round robin DNS

I'd like to implement a round robin DNS to distribute load between a two virtual web server instances. Is this as simple as adding an additional A record for the second instance in my DNS?

Joe

5 Replies

@jkinsell:

I'd like to implement a round robin DNS to distribute load between a two virtual web server instances. Is this as simple as adding an additional A record for the second instance in my DNS?
Yes, but: If you have sessions, make sure a client can hit each of your Web servers and still have access to their session (potentially created on the other). Depending on the resolver, a client could flush cache and switch servers at any point.

Also, it might not be a bad idea to drop the DNS TTL to a fairly low value. If one web server goes down, this will help you remove it from the rotation promptly. (Good load balancing segues nicely into good fault tolerance.)

Bonus points for using your monitoring system to update DNS automatically via the API. :-)

You know what would be cool… If you could get your servers to talk to eachother and determine based on load if servers should be omitted from the pool for a bit to help lower load. This would be good if you staggered daily jobs so only one server ran them at a time.

On a webserver, removing a server from the roundrobin to relieve load would result in that server having zero load after perhaps a second. Unless you intend to add/remove servers to the round-robin every few milliseconds, you couldn't balance load like that.

What you could do is have servers issue temporary redirects to other servers if the load was too high. A redirect is very light on the resources compared to loading a full blown dynamic site.

If each server has some way of knowing the load of each other server (perhaps each server updates their load in a database keeping the few records in a MEMORY table), they could issue redirects for requests to the server with the lowest load. Although at that point, you might as well just set up a dedicated load balancer.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct