# Chrony as pool server

**URL:** <https://community.ntppool.org/t/chrony-as-pool-server/54>\
**Category:** Server operators\
**Created:** [December 30, 2016, 12:54pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54 "2016-12-30T12:54:09Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [December 30, 2016, 12:54pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/1 "2016-12-30T12:54:09Z")

</div>

Are there any server operators out there who have run Chrony instead of ntpd as a server in the pool?

I’m interested to see what it’s like for CPU performance compared with ntpd.

On a busy pool server I regularly see 60-80% of a CPU core used and unfortunately ntpd isn’t multithreaded and can’t make use of more than 1 core on a box. Chrony is also limited the same from what I’ve read.

---

<div class="post-metadata">

**Author:** ![jan-philipp.benecke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/jan-philipp.benecke/32/8_2.png) [@jan-philipp.benecke](https://community.ntppool.org/u/jan-philipp.benecke)\
**Post date:** [December 30, 2016, 1:41pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/2 "2016-12-30T13:41:07Z")

</div>

At the moment i setup a server for the africa zone.  
I could use Chrony instead of ntpd and test it ?

---

<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:** [December 30, 2016, 5:25pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/3 "2016-12-30T17:25:27Z")

</div>

> [@josephb](#):
>
> Are there any server operators out there who have run Chrony instead of ntpd as a server in the pool?
> 
> I’m interested to see what it’s like for CPU performance compared with ntpd.
> 
> On a busy pool server I regularly see 60-80% of a CPU core used and unfortunately ntpd isn’t multithreaded and can’t make use of more than 1 core on a box. Chrony is also limited the same from what I’ve read.

I’m using chrony on my server. I average around 300 pps and my chrony CPU usage is around 2%.

Chrony is also single-threaded and will only use one core.

How much NTP traffic are you getting?

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [December 31, 2016, 3:45am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/4 "2016-12-31T03:45:22Z")

</div>

> [@ddrown](#):
>
> How much NTP traffic are you getting?

Approx 5k to 10k pps.

I might spin up a Ubuntu VM and run the latest Chrony release, put it into the pool and see how it goes.

Given Chrony is also single threaded it might not be a lot difference CPU wise compared to ntpd.

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [December 31, 2016, 3:47am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/5 "2016-12-31T03:47:26Z")

</div>

> [@jan-philipp.benecke](#):
>
> I could use Chrony instead of ntpd and test it ?

If you do that, it would be great if you posted some feedback here 👍

I’ve noticed that the Chrony version in most Linux distributions seems a way behind the latest releases.

---

<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:** [December 31, 2016, 4:09am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/6 "2016-12-31T04:09:19Z")

</div>

How much traffic are you seeing to cause that sort of load? My pool server on 100 Mbps barely cracks 2% CPU. (See [http://serverfault.com/a/813122/129161](http://serverfault.com/a/813122/129161) for further discussion.)

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [December 31, 2016, 5:19am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/7 "2016-12-31T05:19:36Z")

</div>

> [@paulgear](#):
>
> How much traffic are you seeing to cause that sort of load?

A “Net speed” of 100Mbps in an underserved pool region (eg AU) will result in a lot more traffic than a “Net speed” of 100Mbps in one of the larger regions like UK, US etc.

Nice article too!

---

<div class="post-metadata">

**Author:** ![mnordhoff](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/mnordhoff/32/1470_2.png) [@mnordhoff](https://community.ntppool.org/u/mnordhoff)\
**Post date:** [December 31, 2016, 8:05am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/8 "2016-12-31T08:05:15Z")

</div>

> [@paulgear](#):
>
> How much traffic are you seeing to cause that sort of load?

I don’t know about @josephb, but in my experience, a VM would use 70% CPU at 10,000 queries per second.

---

<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:** [December 31, 2016, 9:15am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/9 "2016-12-31T09:15:08Z")

</div>

Maybe I need to bump up my pool setting; during the peak of the snapchat surge I saw around 14K qps maximum, and there were a couple of spikes up to 100% CPU, but most of the time it was well below 50%.

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [January 1, 2017, 12:05am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/10 "2017-01-01T00:05:34Z")

</div>

> [@mnordhoff](#):
>
> but in my experience, a VM would use 70% CPU at 10,000 queries per second.

Can confirm that’s about what I see.

It’s why I thought I might give Chrony a try to see if it is any better performance, although it’s still a single threaded application 😵

---

<div class="post-metadata">

**Author:** ![mlichvar](https://avatars.discourse-cdn.com/v4/letter/m/e79b87/32.png) [@mlichvar](https://community.ntppool.org/u/mlichvar)\
**Post date:** [January 1, 2017, 3:57pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/11 "2017-01-01T15:57:29Z")

</div>

In my experience chronyd needs slightly less CPU that ntpd, but most of the CPU time is the kernel receiving and sending the packets. Switching to chronyd will not help much with that.

To reduce the usage more, it may be necessary to increase the limits for interrupt coalescing with ethtool -C in order to reduce the number of interrupts. Of course, this has a negative impact on accuracy of NTP timestamps (unless the NIC supports and chronyd is configured to use HW timestamping). For a pool server that may be acceptable. For start, you could try setting rx-usecs to 100 and rx-frames to 20.

Some NICs have adaptive interrupt coalescing and changing the values with ethtool may not do anything. These should be able to handle larger packet rates in default configuration. For example, a machine with an Intel i210 card I use for testing can handle up to about 250kpps.

I’m not sure how much this is useful in virtual machines.

---

<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:** [January 2, 2017, 12:17am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/12 "2017-01-02T00:17:40Z")

</div>

Virtual Machines typically can’t set coalescing values:

```
# ethtool -c eth0
Coalesce parameters for eth0:
Cannot get device coalesce settings: Operation not supported
```

---

<div class="post-metadata">

**Author:** ![jan-philipp.benecke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/jan-philipp.benecke/32/8_2.png) [@jan-philipp.benecke](https://community.ntppool.org/u/jan-philipp.benecke)\
**Post date:** [January 2, 2017, 7:35am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/13 "2017-01-02T07:35:21Z")

</div>

So some interim results.

As you can see, the CPU load is quite low even in peaks in the packet quantity. Unfortunately, I have no Munin graphics with the ntpd.

In addition, it seems to me that chrony is a bit more synonymous with the topic of synchronization. What you see also in the graph here in the NTP pool.

I’ll keep watching this.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/ntppool/original/1X/52cf0c2bf73037307576b35c2302bcdf4823986f.png)

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/ntppool/original/1X/d056eba330f0f433a56ec387738143fc827e659a.png)

PS: At the moment chrony is running with 3.4% cpu at avg. 1kpps

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [January 2, 2017, 10:37am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/14 "2017-01-02T10:37:26Z")

</div>

> [@jan-philipp.benecke](#):
>
> the CPU load is quite low even in peaks in the packet quantity.

Thanks for the graphs and feedback, which Chrony version are you using?

---

<div class="post-metadata">

**Author:** ![jan-philipp.benecke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/jan-philipp.benecke/32/8_2.png) [@jan-philipp.benecke](https://community.ntppool.org/u/jan-philipp.benecke)\
**Post date:** [January 2, 2017, 11:10am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/15 "2017-01-02T11:10:01Z")

</div>

The newest one (2.4.1)

---

<div class="post-metadata">

**Author:** ![jan-philipp.benecke](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/jan-philipp.benecke/32/8_2.png) [@jan-philipp.benecke](https://community.ntppool.org/u/jan-philipp.benecke)\
**Post date:** [January 3, 2017, 6:18pm UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/16 "2017-01-03T18:18:01Z")

</div>

Currently there is a peak with about 10k pps at 30% cpu usage.

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/ntppool/original/1X/04812ed62a58728ff0f9ffa3514227416a20fccc.png)

![](https://cdck-file-uploads-us1.s3.dualstack.us-west-2.amazonaws.com/flex016/uploads/ntppool/original/1X/ab81fd4576bef55ea2fb443844bc3cb9399fecac.png)

---

<div class="post-metadata">

**Author:** ![josephb](https://sea2.discourse-cdn.com/flex016/user_avatar/community.ntppool.org/josephb/32/7_2.png) [@josephb](https://community.ntppool.org/u/josephb)\
**Post date:** [January 4, 2017, 3:14am UTC](https://community.ntppool.org/t/chrony-as-pool-server/54/17 "2017-01-04T03:14:27Z")

</div>

> [@jan-philipp.benecke](#):
>
> Currently there is a peak with about 10k pps at 30% cpu usage.

Good data.

I suspect the peak is probably higher, munin is likely to be smoothing it over several time periods for the graphs.
