[CentOS] clock sync/drift

Wed Jan 23 05:21:42 UTC 2013
Ron Loftin <reloftin at twcny.rr.com>

On Tue, 2013-01-22 at 21:16 -0600, Matt Garman wrote:
> Hi,
> 
> We have a little over 100 servers, almost all running CentOS 5.7.
> Virtually all are Dell servers, generally a mix of 1950s, R610s, and
> R410s.
> 
> We use NTP and/or PTP to sync their clocks.  One phenomenon we've
> noticed is that (1) on reboot, the clocks are all greatly out of sync,
> and (2) if the PTP or NTP process is stopped, the clocks start
> drifting very quickly.
> 
> If it was isolated to one or two servers, I'd dismiss the issue.  I
> also had this problem under CentOS 4.
> 
> I suspect something is mis-configured, because I can't imagine the
> hardware clock on ALL these servers is *that* bad.

Well -- in my experience ( 15+ years with RH variants of Linux, and ~25
with various Unix flavors ) they CAN be that bad -- especially with some
of the "economy" chipsets used with the Intel architecture.  It gets
worse when you have a CMOS battery that's getting old and weak.  The
clock may default back to its initial value, or it might just run slow.

Some folks might consider this a "brute force" approach, but I keep it
simple and just reset the hardware clock once a week via cron.  I prefer
to do it in the wee hours, shortly before the weekly cron jobs run on
Sunday morning.  Put something like this in root's crontab.

3 3 * * 0       /sbin/hwclock --systohc

For the gory details, refer to the man page for "hwclock" and it will
tell all.

> 
> Anyone else dealt with anything similar?
> 
> Thanks!
> Matt
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
-- 
Ron Loftin                      reloftin at twcny.rr.com

"God, root, what is difference ?"       Piter from UserFriendly