Hi, newbie here.
I switched from ntpsec to chrony (debian12). Same upstream servers. The score was 20, now it is 17.4. About 10 hours since the switch.
hi magnemann, welcome to the NTPpool community board.
Although I’m not familiar with the settings and behavior of chrony, the screenshot does not look good. I doubt that scores will still converge.
Could you please runthe following command on chrony: chronyc tracking. Maybe this will tell us a little more about what’s going on.
Thanks Kets and Sebhoster!
Heres more info.
The ‘ok’ ntpsec server was a LXC server in proxmox.
The 'bad ’ chrony server is a clone of the LXC. (removed ntpsec, installed chrony, installed netdata.)
root@chrony ~# chronyc tracking
Reference ID : C23ACA94 (sth2.ntp.netnod.se)
Stratum : 2
Ref time (UTC) : Fri Mar 29 10:52:02 2024
System time : 0.000001080 seconds slow of NTP time
Last offset : +0.078537531 seconds
RMS offset : 0.066792563 seconds
Frequency : 3751.867 ppm slow
Residual freq : -97.271 ppm
Skew : 328.474 ppm
Root delay : 0.013544550 seconds
Root dispersion : 0.067402497 seconds
Update interval : 6.4 seconds
Leap status : Normal
Has anything else changed? Server’s bandwidth setting in the pool portal? Network configuration/connectivity? Higher load on the Internet link or a gateway/firewall in front of the system? Load on the platform where the container is running?
That looks like there are two things trying to control the system clock at the same time, fighting with each other. Is there any other NTP client running, e.g. the default one of proxmox?
Thanks, good suggestions.
I dont think anything has changed.
As I said, I cloned the ‘ok’ LXC container running ntpsec, installing chrony on the clone. Also I changed the private IP.
I might double-check that not anything else on the LAN is using the same IP.
Its easy to eliminate factors you mention by switching back to the ‘ok/old’ LXC.
Thanks, you might be into something.
The physical host running proxmox is also running chrony. And it has ‘rtcsync’ in config.
Could it be that both host and LXC is setting the hardware clock, making a mess?
I would remove that line. Never seen anybody use it.
Also it looks to me your system-clock is way off, do it doesn’t know what clock to believe to be correct.
If you know one of them if correct and never fails, then you may want to give it the TRUST of PREFER status, so chrony knows it should be the correct one.
Typical a stratum 1 server should be used for TRUST, as it’s synched with a STRATUM 0 provider via an (in)direct link like a GPS.
I know of these to be always correct as they are Belgian Astronomy timeservers:
server ntp-main-1.oma.be trust
server ntp-main-2.oma.be trust
However, you should install the 2 trusted servers I gave you, so Chrony can work out the correct time.
It should normalize after 30 minutes or so.
Then run ‘chronyc makestep’ a few times, like every 5 minutes, and it will bring the sysemtime to the real time. And chrony will know what the real time is.
Then the monitors will normalize too. If not, you have other problems.
Hardware clock as in RTC is not usually used while the system is running, only read upon system startup to get initial time, then set periodically to stay in sync while the system is running, but not usually read anymore.
Rather, containers (unlike VMs) run on the kernel of the host system, so I guess both chronyd inside as well as the one outside the container trying to manage time on the same kernel sounds like asking for trouble
Allright, its looking better now after I disabled chrony on proxmox host.
I think the reason for the trouble was LXC and proxmox host both set the system time, both running chrony.
Trying to wrap my head about this, good to have some trouble to learn a bit.
Have I understand the following?
‘hardware clock’ is always used to set system time at boot, may be set later also by e.g. chrony. This clock is not used actively by chrony.
‘system time’ is used for everything in linux, e.g. ‘date’ command and the journal. System time is set often/10min by chrony.
‘true time’ (is this the right term?) is the true time for the world. Estimated by chrony. When true time is copied to system time, the system is ‘synchronized’.
Are there more ‘times’?
So… Does proxmox host and LXC have common system time (they share kernel)? Is it best practice to disable ntp client on the host, if running a time server on LXC?
Thanks, interesting info!
Im sure these are accurate servers. But I dont know anything about the latency from Norway to Belgium. Also I believe one should not trust anything in this protocol.
How do I find the ‘best’ servers? Should I choose stratum 1 or 2? What happens If I choose some stratum 1 and some stratum 2 as upstream servers, what will my own stratum be?
if you’re locked to a stratum 2 server, you’d be stratum 3 (2+1). But I think there’s preference for the stratum 1 server, so probably stratum 2 (1+1).
I see you use one of my servers, tnnss.net, as a source. Like most of the servers in Norway, it uses ntp.justervesenet.no as its primary source, which is run by the Norwegian Metrology Service. Another service you can trust is Swedish Netnod, who also supports NTS.
The roundtrip time should be great with these, and I’m seeing a ping time within the millisecond (0.9ms) to Justervesenet’s server and a steady 7.6ms to Netnod.
The cheapest way is to get an GPS, either module USB+PPS, Garmin 18X (requires 5 wires to solder) or an U-blox module but requires soldering and electronic knowledge.
The USB module that has PPS, in ready made form costs about 80 euro.
The Garmin is about 100 euro including shipping, my favorite (some disagree )
The U-blox modules are very cheap, but you need converters and electronic skills, the module itself is about 10~20 euro.
If you do not care about PPS, then an USB module could be found for 10~15 euro, but it’s not precise enough, but could help setting the right time.
The most easy one to use and install is this one:
Navisys GR-701W u-blox-7 USB PPS GPS/qzss & GLONASS ontvanger
All via USB, just plug it in an USB port and off you go