7

My hosting is charging me a $50/month fee to put my servers on the same VLAN so that I create a cluster using the Network Load Balancing feature.

I'm really not needing split the load between the servers, I was looking for an easy way to create a failover scenario to protect against servers failures. However, I consider this fee is little expensive.

Is there any way that I can create a cluster without using the NLB? Maybe something that monitors my primary server and changes the DNS for the domain when it goes down?

1
  • if application availability is critical to you then 50 bucks a month is a bargin...
    – Alnitak
    May 10, 2009 at 14:55

5 Answers 5

9

DNS is a poor choice for simulating failover. The reasons are

  • DNS records a valid for a period of time, to achieve realtime failover you'd need to lower the TTL on a DNS entry to be so low that every request to your site would result in a DNS lookup. Which will seriously slow the experience for your visitors
  • There are some suspicions that even today DNS entires with very low TTL values are not respected by ISP's and older broken name servers.
  • Using Round Robin DNS will not provide failover because on average 50% of the requests will go to each IP listed. This actually would work if the higher level protocols of HTTP had retrying built in.

My suggestions would be

  • If your second server is in the same hosting company, then look into renting a real load balancer, either for your own use, or most hosting companies can rent you part of their shared load balancing infrastructure
  • Use something like spread or linux HA servers to assign the service to a floating virtual IP which is passed between your physical servers. The servers in the cluster monitor each other and decide who is the current owner of the virtual IP.

I highly recommend reading Scalable Internet Architectures by Theo Schlossnagle as he covers this in great detail

4
  • 2
    +1 - DNS is not the answer to high-availablity or load balancing
    – Alnitak
    May 10, 2009 at 14:56
  • @Alnitak: Be that as it may, and although I generally agree with you, I've seen enough occurrences of registrars' DNS going AWOL for periods of time that I would still think it's a valid question and concern. In fact, over the past 2-3 years, most of the downtimes on the web-apps I've managed where caused by DNS issues and accounted for the biggest chunk of time. (Somewhat recently, a manual configuration change on the OVH registrar caused its DNS to go down in a number of locations and a significant number of hours, for instance).
    – haylem
    Nov 10, 2021 at 14:59
  • @haylem you're talking about redundancy there, not real-time HA / LB.
    – Alnitak
    Nov 11, 2021 at 10:33
  • @Alnitak: Yes, definitely not LB, as it's not related at all to load. But to dissociate it from HA would seem misguided to me. And yes, it is about redundancy of all services that are between your server and your customer, including DNS.
    – haylem
    Nov 11, 2021 at 14:36
2

You could set up a separate load balancing box with ldirectord, which monitors your web servers, and load-balances between whichever ones are currently live (and by extension, keeps the site up when one server goes down). We use this solution to allow us to re-boot either one of our two webservers without affecting the site's uptime.

In fact, if your webservers are linux boxes, you can run ldirectord on the webserver itself, and use heartbeat to keep ldirectord running on the live box.

This solution allows you to share a common IP address (or more than one) between two or more boxes, and avoid the DNS issue altogether.

1

One way would be to have your site on two different servers, then have a site monitor at a third location that monitors the connection to the main server (where your DNS usually points). If it detects that the site is down, have the monitor execute a script or hit the update URL of a dynamic dns provider (such as DtDNS [which I operate], or DynDNS.com) with the IP address of your backup server specified for your domain/hostname. This will update the DNS record and direct traffic to your backup web server. When the main site is back online, the monitoring can run another script or URL that will put the "real" IP back.

One key here is to have DNS hosted at a provider that has an API into their system so that your domain can be updated quickly, and that keeps the TTL low enough so that visitors will be redirected relatively quickly.

Another is that the site has to be monitored from an outside, objective location. You cannot run monitoring on the same web server as the site is on. If the whole server goes down, the monitoring/update method will go right down with it.

1
1

SimpleFailover does more or less what you want. Remember DNS gets cached, so it's not a perfect solution.

With respect to multiple A records, I've seen discussion recently regarding Vista and Win Server 2008 implementing RFC3484, meaning you can't rely on round-robin and are likely to get uneven server loading from these clients.

2
  • 2
    indeed - RFC3484 was never supposed to apply to IPv4, and MS were wrong to extend it to do so.
    – Alnitak
    May 9, 2009 at 22:39
  • 1
    You can disable the RFC3484 setting in Windows 2008 and Vista. Here's a link to the MS Enterprise Networking Team blog discussing the Windows RFC3484 implementation. blogs.technet.com/networking/archive/2009/04/17/… May 10, 2009 at 1:32
1

DNS Made Easy allows you to set up your DNS so that if the server is down, it points you somewhere else. In our case, we have a static page that says the site is down, try again later.

If you use DNS in this way, you need to configure a relatively short TTL to get around the cacheing issue.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .