Date: Fri, 5 Oct 2018 13:08:10 +0100 From: Matthew Seaman <matthew@FreeBSD.org> To: freebsd-hackers@freebsd.org Subject: Re: ntpd strange problem Message-ID: <a31ca466-3ef6-8a66-10cc-1c24cd6dc928@FreeBSD.org> In-Reply-To: <alpine.BSF.2.20.1810051122310.9032@puchar.net> References: <alpine.BSF.2.20.1810041557330.94038@puchar.net> <20181005061829.GG21091@server.rulingia.com> <alpine.BSF.2.20.1810051122310.9032@puchar.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On 05/10/2018 10:24, Wojciech Puchar wrote: >>> 0x2041: Clock Unsynchronized >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >> >> It will take 5-10 minutes for ntpd to synchronise to its upstream >> servers. >> Until then, the clock will report that it's unsynchronised. If "ntptime" >> is still reporting that it's unsynchronised after a long period, you will >> need to do more troubleshooting. > > yes the problem is that: > > after starting ntpd time is exactly fine > > ntpd_sync_on_start=YES > ntpd_enable=YES > > > but then while ntpd works, time seems to get out of sync to the extent > of normal RTC imprecission - in order of few seconds per day. > > ntpd seems like not to update time properly. > > restarting ntpd fixes time again. > > what should i look at to find a source of problem Is this a virtual machine or bare metal? VMs tend to have a lot more problems with clock drift -- they lose time when the hypervisor switches them off the CPU. Then if the clock gets more than a certain amount out of sync, ntpd just gives up. You can add: tinker panic 0 to ntpd.conf to make that less likely to happen. If it's bare metal then it sounds like your system clock is running much faster or slower than ntpd can manage to correct. That's a hardware problem, but there are some tunings that may allow ntpd to cope. If you enable a drift file (which I think is enabled by default): driftfile /var/db/ntpd.drift then ntpd will record how fast or slow the clock tends to run so it can immediately account for that across restarts, rather than having to work it out de-novo everytime ntpd gets restarted. Cheers, Matthew
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?a31ca466-3ef6-8a66-10cc-1c24cd6dc928>