# Does load-balancing make sense for NTP?

**URL:** <https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751>\
**Category:** Server operators\
**Created:** [July 31, 2020, 5:38pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751 "2020-07-31T17:38:00Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![SimonKepp](https://avatars.discourse-cdn.com/v4/letter/s/a587f6/32.png) [@SimonKepp](https://community.ntppool.org/u/SimonKepp)\
**Post date:** [July 31, 2020, 5:38pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/1 "2020-07-31T17:38:01Z")

</div>

I’m planning to setup an NTP service in my lab, and joining it to the pool for public access. My plan is to run an internal/private Statum 1 appliance with a GPS sync, and then below that add one or more stratum 2 servers in my DMZ to join the pool. However, as I only have 1 public IP address, I cannot expose more than one of these directly to the public. One possible solution would be to add a load-balancer in front of the several stratum 2 servers, which would increase availability, but As the various stratum 2 servers are not 100% in sync, I’m wondering, if load-balancing between several tightly syncronized stratum 2 servers would actually do more harm than good?

---

<div class="post-metadata">

**Author:** ![ziegenberg](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/ziegenberg/32/601_2.png) [@ziegenberg](https://community.ntppool.org/u/ziegenberg)\
**Post date:** [July 31, 2020, 6:08pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/2 "2020-07-31T18:08:21Z")

</div>

How would you ensure that the same client always arrives at the same server?

---

<div class="post-metadata">

**Author:** ![paulgear](https://avatars.discourse-cdn.com/v4/letter/p/ad7895/32.png) [@paulgear](https://community.ntppool.org/u/paulgear)\
**Post date:** [July 31, 2020, 7:21pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/3 "2020-07-31T19:21:53Z")

</div>

TL;DR: Your instincts are right. Load balancing NTP doesn’t make sense, and can do more harm than good.

[RFC8633](https://tools.ietf.org/html/rfc8633#section-7) (NTP Best Current Practice) has a section on anycast, and the same considerations apply to load balancers.

If you have only one public IP address, expose just one stratum 2 server to the pool.

---

<div class="post-metadata">

**Author:** ![ddrown](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/ddrown/32/11_2.png) [@ddrown](https://community.ntppool.org/u/ddrown)\
**Post date:** [August 5, 2020, 5:02pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/4 "2020-08-05T17:02:42Z")

</div>

If your main goal is availability, you can use your load balancer’s failover mechanisms to only send traffic to one server at a time.

---

<div class="post-metadata">

**Author:** ![kenyon](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/kenyon/32/45_2.png) [@kenyon](https://community.ntppool.org/u/kenyon)\
**Post date:** [August 5, 2020, 5:23pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/5 "2020-08-05T17:23:21Z")

</div>

Previous thread on this: [Thinking of joining, is load balancing okay?](https://community.ntppool.org/t/thinking-of-joining-is-load-balancing-okay/959)

---

<div class="post-metadata">

**Author:** ![Bas](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/bas/32/465_2.png) [@Bas](https://community.ntppool.org/u/Bas)\
**Post date:** [July 18, 2021, 6:16pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/6 "2021-07-18T18:16:35Z")

</div>

I use 4 servers and they are all called with ntp.heppen.be, so they devide the load.  
My primary server is GPS+PPS and all other connect to stratum1 servers as well.  
However, I do not load-balance over 1-IP-adress, that isn’t usefull at all.  
I load-balance via DNS over 4 different servers. My load-balance is basically my own ntp-pool.

---

<div class="post-metadata">

**Author:** ![Clock](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/clock/32/757_2.png) [@Clock](https://community.ntppool.org/u/Clock)\
**Post date:** [July 19, 2021, 12:40am UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/7 "2021-07-19T00:40:39Z")

</div>

How do you use Round Robin DNS balancing if the pool directly distributes the server’s IP address instead of the domain?

---

<div class="post-metadata">

**Author:** ![Bas](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/bas/32/465_2.png) [@Bas](https://community.ntppool.org/u/Bas)\
**Post date:** [July 25, 2021, 3:47pm UTC](https://community.ntppool.org/t/does-load-balancing-make-sense-for-ntp/1751/8 "2021-07-25T15:47:28Z")

</div>

Well it’s quite simple to do.  
You just make 4 A-records in your domein for e.g. [ntp.yourdomein.org](http://ntp.yourdomein.org) but every entry points to a different IP.

After you done that, you can check your round-robin with nslookup and it will do this:

root@server:~# nslookup ntp.heppen.be  
Server: 192.168.1.1  
Address: 192.168.1.1#53

Non-authoritative answer:  
Name: ntp.heppen.be  
Address: 77.109.90.72  
Name: ntp.heppen.be  
Address: 176.9.206.139  
Name: ntp.heppen.be  
Address: 82.161.251.125  
Name: ntp.heppen.be  
Address: 5.196.189.119

The client will take the fastest server over time anyway.  
This is the most basic way of load-balancing, but it works for me.

Funny is, if I signup ntp.heppen.be to the pool it inserts all 4 servers in 1 click.
