Recommended settings for chrony on KVM

Hello,

I operate chrony 4.2 on Debian 11 in a KVM virtualized system with 4 dedicated CPU cores (KVM host is a AMD EPYC 7452).

Are there any recommended settings for the operating system and/or chrony in such an environment?
To name a few chrony settings, what about filter / minsamples / clockprecision?

The reason for my question is: I’ve noticed that the values in the columns NP and NR of chronys’ sourcestats command conspicuously often fall back to the minimum values (6|3), and they also rarely get high.

You can not control the local-system-clock from a virtual system.

Just run it with server or pool params and it will work fine.

You’re right. I use a dedicated server now, and maybe you have a hint for me, I really don’t get it…

The server has a Intel i210 NIC, ethtool -T shows

Capabilities:
        hardware-transmit
        software-transmit
        hardware-receive
        software-receive
        software-system-clock
        hardware-raw-clock
PTP Hardware Clock: 0
Hardware Transmit Timestamp Modes:
        off
        on
Hardware Receive Filter Modes:
        none
        all

After starting the system there’s a /dev/pps0 and /dev/ptp0.
Running chrony with hwtimestamp eth0 reports Enabled HW timestamping on eth0.

What I don’t know and really don’t understand now, should or do I have to install the package linuxptp to use

  • ptp4l ?
  • phc2sys ?

And even without linuxptp installed, is it helpful/recommended to configure something like this in chrony:

refclock PHC /dev/ptp0 pps

There is no special configuration.
Sync your hypervisor with a Reflcock or (Pool)server and on the client do the same. That’s it.
Or you can sync the hypervisor and use a client clock which sync with the hypervisor. IIRC Amazon EC2 is doing likely the same.

Maybe Red Hat have some good suggestions:

I don’t have one anymore, see previous post :slight_smile:

It’s my understanding that your NIC doesn’t have a clock, it just stamps network packages in order to minimise the offset.
Also, for it to work, all NIC’s need hardware timestamping else it’s ignored as far as I know.

In order to get accurate time from a refclock, you still need a GPS with PPS.

As for onboard clocks, forget about those, none of them is accurate and they wander all over the place.

Only if there is PTP provided in the local network and you would want to use it as a time source.

No, the clock would need to be synchronized (e.g. by ptp4l) to be useful as a reference clock.