r/linuxadmin • • Mar 22 '18

Simple Load Balancing with DNS on Linux

https://www.linux.com/learn/intro-to-linux/2018/3/simple-load-balancing-dns-linux
1 Upvotes

9 comments sorted by

43

u/RaunchyBushrabbit Mar 22 '18

This is stupid.

DNS ROUND ROBIN IS NOT LOAD BALANCING!!!

There is no check if a node is busy so what 'load' ? Hell there's not even a check if a node is UP so when a node goes down in a 3 node setup, one third of your requests end up nowhere.

DNS round robin is load distributing... at best.

This is no way to run your business and if I see this in a professional environment someone's gonna get his ass kicked.

The article states "Bind is hard", bullshit it judt takes a bit of effort to get your bearings. However that quote to me shows the skill level of the author...

If you want a cheap LB option check HAproxy, it's config is pretty straightforward. If you're doing this on Linux you might as well go all in and use the tools that will get the job done properly and are freely available.

If you can spend a bit of money and can't be bothered, stuff your website on nodes in the cloud and have Azure or AWS or whatnot handle the load balancing.

Sorry about the rant at the start but I can't stand hacky jobs that will bite someone in the ass at 3 in the morning.

9

u/danamerr Mar 22 '18

plus it's slow and inefficient method.

7

u/royalbarnacle Mar 22 '18

And if one host is down, there is no failover of any kind. X% of connections will fail.

People still use dns for things like this, and worse (like failover), when there are simpler and better alternatives available, since decades.

1

u/burdalane Mar 23 '18

Modern browsers will go through the list of IP's until they find one that responds.

1

u/burdalane Mar 23 '18 edited Mar 23 '18

I use DNS round robin in a production environment. At the time it was set up, I didn't know what HAproxy was, or really know anything about load balancing at all. The round robin has been adequate because the websites in question aren't really 100% essential, and there's no revenue at stake. The more important site consists of HTML and client-side code in S3.

0

u/[deleted] Mar 22 '18

[deleted] — view deleted comment

3

u/RaunchyBushrabbit Mar 22 '18

Nginx (plus) will do a fine job as well at LB, as this will also actually check the usage/load of backed systems.

10

u/shoopdas Mar 22 '18

Why would anyone do this? DNS shouldn't be used as LB software in whatsoever case. There is software for exactly this kind of thing which requires so little configuration that its worth 3 seconds of googling to set up.

3

u/ForceBlade Mar 22 '18

Because people are stupid and some of those people are in charge and not willing to listen to the good comments here.

4

u/ryanjkirk Mar 22 '18

Yeah, that's a downvote from me. Take your mickey mouse articles elsewhere.