[ntp:questions] System Time (date) Does Not Agree With Hardware Clock Time (hwclock)

Steve Kostecke kostecke at ntp.org
Mon Jul 23 20:57:39 UTC 2007


On 2007-07-23, gldickens3 <gldickens3 at gmail.com> wrote:

> I am new to both ntp and this newsgroup. I recently configured and
> began using npt on my Linux server. I am running CentOS release 4.5
> version 2.6.9-55.0.2.ELsmp and npt version 4.1.1b-r5 which was
> preloaded with my CentOS Linux distribution.

The current stable version of NTP is 4.2.4p3

> I am having a problem with my system time, reported via the "date"
> command in that it doesn't agree with the hardware clock time,
> reported via the hwclock command. The "date" command reports time that
> is always 23 seconds behind the time reported by the "hwclock --show"
> command.  It appears that the time reported by "hwclock" is accurate
> in that it agrees with other ntp servers that I query.  Whereas, it
> appears that the time reported by "date" is inaccurately slow by 23
> seconds.

The hardware clock (i.e. RTC) is only used to store the system time when
your computer is shut down. The RTC is updated periodically, and at
system shut down, from the system clock.

ntpd only disciplines the system clock in the kernel (the "date" time).

> Can anybody tell me how to make "date" time accurately equal "hwclock"
> time?

The RTC is less accurate than the virtually any wrist-watch. NTP, on the
other hand, can keep the system clock to within milli-seconds of UTC
over a LAN/WAN and, given the right OS and hardware, to within
micro-seconds of UTC via a radio clock.

> - Both "date" and "hwclock" will remain correctly in agreement with
> other ntp servers for several minutes.
>
> - Then, the jitter values for the servers with which I am syncing go
> up to around 8700 (my jitter values are normally less than 10).
>
> - Then the ntpd daemon quits syncing (no asterisk "*" next to any
> server) and the jitter values go to around 18000.
>
> - After which the offsets go to 23000 milliseconds (my offset values
> are normally under 100 milliseconds) although both the "date" and
> "hwclock" command continue to agree with other ntp servers.
>
> - Following all this, and after about 15 minutes, everything goes back
> to how it was in the beginning with the "date" time trailing the
> "hwclock" time and other ntp servers by about 23 seconds and with
> offsets under 100ms and jitter less than 20.

Is this cycle regular? Are the offsets of similar magnitude and always
in the same direction? Are these offsets connected to anything occuring
on the sytem (e.g. "busy" periods, cron jobs, etc.)?

You may have ...

* bad hardware

* network problems

* OS problems

-- 
Steve Kostecke <kostecke at ntp.org>
NTP Public Services Project - http://support.ntp.org/




More information about the questions mailing list