Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
13

DNS round robin is not a good substitute for a load balancer. The DNS server will continue to hand out the IP of the node that is down, so some of your users will get to your service and some of them will not. When the client makes the DNS query, the DNS server returns all of the IP addresses associated with that name. The magic is done by the DNS server ...


13

Using a Load Balancer will still leave a single point of failure. If your load balancer goes offline, your website goes down. Conterary to the above answer, Most HTTP clients already DO support trying each IP address returned from a DNS query until one returns with a valid response. Please see here: http://blog.engelke.com/2011/06/07/web-resilience-with-...


11

The canonical solution to this is to not rely on end user IP address, but instead use a Layer 7 (HTTP/HTTPS) load balancer with "Sticky Sessions" via a cookie. Sticky sessions means the load balancer will always direct a given client to the same backend server. Via cookie means the load balancer (which is itself a fully capable HTTP device) inserts a cookie ...


9

dnsmasq inludes Round-robin DNS out-of-the-box > egrep -m1 '^nameserver' /etc/resolv.conf nameserver 127.0.0.1 > grep -i rrtest /etc/hosts 1.1.1.1 rrtest 2.2.2.2 rrtest > /etc/init.d/dnsmasq restart Shutting down dnsmasq: [ OK ] Starting dnsmasq: [ OK ] > nslookup ...


7

No, that doesn't work. Also /etc/hosts is a primitive form of name->address mapping that DNS is meant to replace. If you want round-robin DNS, install a DNS server.


7

I would suggest doing all your SSL processing in HAProxy and using the proxy protocol (send-proxy and accept-sslproxy) so client information gets passed from the ssl processor to the frontend+backend. That looks something like: listen ssl-proxy bind 1.2.3.4:443 ssl crt /etc/ssl/mycert.pem npn http/1.1 mode tcp bind-process 2 3 4 server http ...


6

Is there a way to make it so that if sub.domain.com on server A is unavailable, forward to server B until A comes online? Not via DNS - at least not without a custom DNS server monitoring and changing records on the fly (which wouldn't work too well). To get this behavior, you'll need a system in between the clients and the servers handling the failover ...


5

Each browser has it's own method of handling round-robin DNS, I've spent some time today researching this problem and will continue to update my answer as I find proof of implementation which will limit my answers to browsers that expose their behavior. Google Chrome Google Chrome (v58 used) will request all host entries for an address (A, AAAA, CNAME) ...


5

I'm not sure why you want to round robin DNS here,it's completely useless here. The proper setup would be to set your A record to your load balancer. Then set a heartbeat to the Webserver to check if it is online. The idea behind helping during an attack is by spreading the load across several servers and to scale up to compensate and scale down after the ...


4

To answer your question about alternatives: You can get solid layer-7 load balancing through HAProxy. As far as fixing the LVS affinity issues, I'm a bit dry on solid ideas. It could be as simple as a timeout or overflow. Some mobile clients will switch IP addresses while they're connected to the network; perhaps this may be the source of your woes? I would ...


4

My question now is... are there any best prectices / methos / rules of thumb to weight round robin distribution using the TTL attribute of DNS records? Yes, best practice is don't do it !! Please repeat after me DNS is not for load balancing DNS does not provide resiliency DNS does not provide fail-over facilities DNS is for mapping a name to one or more ...


4

So first off let's briefly review what's implied by using anycast for DNS: A given IP address a is the resolver that we wish to make more available. The a host is a member of the A /24 subnet. Anycast can be accomplished with specific host routes (i.e. a/32) but this is generally only seen within private networks, not on the general Internet. There is ...


3

Why are you killing gunicorn? Just send it a SIGHUP like any other well-behaved Unix process and it will happily reload without losing any connections.


3

nginx should do this out of the box. proxy_next_upstream's default error timeout setting will pass a request on to the next member of an upstream block if the initial server chosen is unreachable.


3

The PowerDNS Recursor caches at two levels. It caches responses from authoritative servers for up to the TTL specified in the response it got (limited by max-cache-ttl but never exceeding the TTL it got from an auth). Additionally, when a response packet from the recursor to a client (your clients that are generating load) is generated and sent, this ...


3

DNS does not provide load balancing, so yes unless the host is down it will always utilize a record from the returned list of DNS records. If you want to dynamically handle downed hosts you will have to load balance the incoming connections across your SSH boxes. Round-Robin DNS requests are very rudimentary in terms of load balancing. Check out the ...


3

Notes: How much are you willing to spend, I've yet to see someone relying on VPSs and really wanting to spend the money for a datacenter failure case. Regarding your drawings: The fail in the first one is true if (and only if) the load balancer is a single machine, if it's a single system (as in a system built from multiple hosts) it's not true anymore. ...


3

If you want real load balancing for web server's than you should think about Haproxy . It has high efficiency using reverse proxy and failover system (keep alive & Heartbeat) Haproxy load balancer will work as a front end server for your web server. To know more about Haproxy you should read http://haproxy.1wt.eu/download/1.2/doc/haproxy-en.txt and ...


3

You can use DNS Round Robin (which is enabled by default on a Windows DNS server), but this isn't true load balancing. The DNS server will rotate multiple A records for the resource (once you've created the A records) to the clients querying those A records. For "truer" load balancing you should look at something like NLB or Application Request Routing.


3

Wow - you know this site isn't for beginners right? we make that very clear when you sign up. Anyway - of course Google use 'something with failover', anyone professional would. And yes it appears to be some form of load-balancing, it could be round-robin but it's more likely to be a lot smarter than that, including the use of sticky-sessions though that's ...


3

802.3ad with xmit_hash_policy set to layer3+4 is a bonding mode that is one of the standard, sensible, and widely used ones. Like many others it doesn't allow >100% throughput for a single TCP connection. In practice the fragmented packet disclaimer you quoted is not relevant as far as I've seen. balance-rr is a very specific and rarely used balancing mode. ...


2

F5 GTMs do exactly this, among other things. They do tests on devices to see if they are up, and then change the DNS records to the appropriate value. If you're feeling particularly adventurous you could allow dynamic updates of your DNS zone. Then from host B do checks against host A using some kind of script. If it detects host A is down/unreachable/...


2

Another option is something like CARP. You assign a virtual IP address to both servers, and they ping each other periodically and as long as the 'master' is up, it will get the traffic, but if it stops responding, then the slave takes over that ip. This makes it entirely transparent to the applications. CARP - Common Address Redundancy Protocol


2

See this my question (and answer): How browsers handle multiple IPs. Shortly - round robin dns does not improve availability at all. Browser chooses one IP and sticks to it, even if it does not responds. (Checked with FF and chrome). Once browser dns cache expires, hostname resolved again and the process repeated, regardless of did IP answered or not. For ...


2

edit: Editing my answer since HiPerFreak schooled me. DNS servers will return a list of all A records it has for a given host name. Where round robin comes in is that it rotates how the list is ordered. The link that lain posted is a great example of how web browsers will make use of that list. Round Robinning can be used for a very primitive form of ...


2

Yes, you can implement some load sharing using multiple DNS records for the same service. However, this is not the best way to implement load sharing especially in case you have all your hosts reside in the same location. A far more efficient approach will be to use a dedicated machine as load balancer. This machine receives all traffic and forwards it to ...


2

Yes, it will round robin between the three. For windows server DNS, you need to enable Round Robin in your DNS server. When enabled, it will respond with all three records in a rotating pattern: 1st client - 1.2.3.4, 4.5.6.7, 7.8.9.0 2nd client - 4.5.6.7, 7.8.9.0, 1.2.3.4 3rd client - 7.8.9.0, 1.2.3.4, 4.5.6.7 This depends on the implementation on the ...


2

Take a look at PowerDNS. It allows you to create a custom pipe backend. I've modified an example load-balancer DNS backend written in perl to use the Algorithm::ConsistentHash::Ketama module. This lets me set arbitrary weights like so: my $ketamahe = Algorithm::ConsistentHash::Ketama->new(); # Configure servers and weights $ketamahe->add_bucket("...


2

First off, I completely agree with @Alnitak that DNS isn't designed for this sort of thing, and best practice is to not (ab)use DNS as a poor man's load balancer. My question now is... are there any best prectices / methos / rules of thumb to weight round robin distribution using the TTL attribute of DNS records? To answer on the premise of the question, ...


2

Q1: yes. *.domain.com will match any domain above domain.com ex: a.domain.com a.a.domain.com a.a.a.domain.com etc. Q2: This should work If you want global pool of IP's *.domain.com IN A 1.1.1.1 *.domain.com IN A 2.2.2.2 *.domain.com IN A 3.3.3.3 this is ok and will work (tested in djbdns)


Only top voted, non community-wiki answers of a minimum length are eligible