Graham Briggs wrote:
Correcting giant leaps can take somewhat long, as ntpd has to ensure that the time is going forwards all the time, so usually during
boot, a ntp-client call is done which just sets the time based on a known server. After that ntpd should run and keep the clock synchronised
with 1 or more other servers. Are you sure the ntpd has a list of
(valid and reachable!) ntp servers so it can properly adjust the time?From what I've read online, it's a creeping system clock issue in
the Linux kernel (the clock gains a minute every 2 or 3 hours, it
gains faster if there's more network usage, ntpd cannot compete with
that rate of clock skewing). We're going to try using noapic and
other parameters.That, or run a script daily that shuts down dovecot, fixes the time,
then restarts dovecot!ntpd is getting the time correctly. syslog is full of 'adjusting
local clock by -xyzs' messages anyway, byt xyz goes up - in 24 hours
it is now 909s!
The maximum drift Linux's adjtime() can correct for (in 2.6, anyway) is 500 PPM (1000 PPM if HZ=1000.) adjtimex() has a hard limit of 512 PPM. Stated another way, that means that the kernel clock can only smoothly gain about 500 seconds for every 1000000 seconds of real time.
Gaining 30 minutes every week works out to almost 3000 PPM, so ntpd alone isn't gonna do the trick. FWIW, I believe that the ntp.org ntpd (ntp-server in Debian, since you mentioned it) will step the time hard if it needs to, but this brings you back to square one -- the time isn't monotonic anymore, and dovecot gets angry about it.
There's a standalone adjtimex utility that's basically a command-line interface to the kernel call, and running adjtimex --tick 9970 ought to bring things into the range where ntpd can keep things in check (depending on how much of an estimate '30 minutes every week' is.)
Cheers for the advice though, I'll pursue the problem somewhere more
relevant from now on!Graham
Dovecot's not the only thing that gets upset when the system time isn't monotonic, but I agree that it'd be nice if it wasn't one of the things that did.
HTH,
Ben Winslow rain@bluecherry.net