# UDP load balancing



## LoZio (May 31, 2010)

Hi all,
 anyone using some program to create a UDP load balancer? I'm using haproxy for TCP and works great, but something for UDP seems more difficult to find, only some-years-old daemons.
I saw something about using pf, but this is not convincing. I need to balance DNS and NTP, and need f/over capabilities using CARP (for example).
Ideas?
Thanks


----------



## dennylin93 (Jun 2, 2010)

Try tweaking the DNS settings. It's much simpler.

Do something like:
For DNS:

```
dig +short google.com ns
ns4.google.com.
ns2.google.com.
ns1.google.com.
ns3.google.com.
```

For NTP:

```
dig +short 0.pool.ntp.org a
140.112.2.189
210.68.16.24
123.204.57.143
```


----------



## LoZio (Jun 3, 2010)

It would be useful, but I have to balance *MY* DNS and NTP servers. I'm not the client.
Clients use IP addresses to access the services.


----------



## pprocacci (Jun 3, 2010)

http://morebalance.coolprojects.org/

It supports UDP as well as TCP.  I've never used this however, but am not aware of anything else.


----------



## dennylin93 (Jun 3, 2010)

LoZio said:
			
		

> It would be useful, but I have to balance *MY* DNS and NTP servers. I'm not the client.
> Clients use IP addresses to access the services.



Is there a reason why domain names can't be used instead?


----------



## LoZio (Jun 3, 2010)

dennylin93 said:
			
		

> Is there a reason why domain names can't be used instead?



Yes, devices (ip phones) have ony a nifty four spaces-three dots window to insert dns and ntp server location...

In any case, having an UDP load balancer has lots+lots+lots of benefits over round robin DNS.
Bye


----------



## LoZio (Jun 3, 2010)

pprocacci said:
			
		

> http://morebalance.coolprojects.org/
> 
> It supports UDP as well as TCP.  I've never used this however, but am not aware of anything else.



Quoting myself:
"only some-years-old daemons."

I just want something reasonably supported, not something abandoned 4 or 5 years ago.
Thanks, anyway.


----------



## dennylin93 (Jun 3, 2010)

LoZio said:
			
		

> Yes, devices (ip phones) have ony a nifty four spaces-three dots window to insert dns and ntp server location...
> 
> In any case, having an UDP load balancer has lots+lots+lots of benefits over round robin DNS.
> Bye



I only have one thing left to suggest then. Use PF for load balancing incoming connections. This does have some limitations, but it should be able to work well for what you need.

Some references:

Load Balance Incoming Connections
TRANSLATION EXAMPLES


----------



## LoZio (Jun 3, 2010)

dennylin93 said:
			
		

> I only have one thing left to suggest then. Use PF for load balancing incoming connections. This does have some limitations, but it should be able to work well for what you need.
> 
> Some references:
> 
> ...



Thanks, is what I told I would like to avoid for several reasons, but if it seems the only way....
It's strange you can find several TCP load balancers (haproxy being phenomenal in my opinion), and no modern UDP lbs.
Thanks


----------



## dennylin93 (Jun 3, 2010)

Perhaps there's no UDP load balancer due to the fact that most people simply use DNS round robin to achieve this and failover.


----------



## LoZio (Jun 3, 2010)

dennylin93 said:
			
		

> Perhaps there's no UDP load balancer due to the fact that most people simply use DNS round robin to achieve this and failover.



With DNS you can obtain poor man load balancing and very very bad failover capabilites with disruption of services.
When you need an affordable service and fast failover/failback DNS is out of the discussion. This is why there are several TCP load balancers with very rich capabilities.


----------



## Christopher (Jun 4, 2010)

Although not free, Zeus Load Balancer can balance UDP datagrams.

http://www.zeus.com/products/load-balancer/index.html


----------



## LoZio (Jun 4, 2010)

Christopher said:
			
		

> Although not free, Zeus Load Balancer can balance UDP datagrams.
> 
> http://www.zeus.com/products/load-balancer/index.html



I tested it and it was not bad, but the entire solution is far more than a load balancer. It features several application performance optimizations, and licensing is somewhat expensive, considering to use is only for UDP.
I'm resorting to test some linux solutions, but I'm not in the mood to put my production servers behind a linux machine...
Thanks


----------

