System clock drifting out of sync with hwclock and ntpd

10,688

Solution 1

Add this parameters at kernel boot line

notsc divider=10 clocksource=acpi_pm

and restart your system. This is related to RHEL 5 Hyper-V Guest - Cannot sync with NTP after kernel upgrade

Solution 2

You can try using another NTPd, such as OpenBSD's one: openntpd

Share:
10,688

Related videos on Youtube

samxli
Author by

samxli

Independent developer working on various projects at a startup.

Updated on September 17, 2022

Comments

  • samxli
    samxli over 1 year

    My current system drifts from the hwclock and ntpd dramatically. I've looked at many forums and posts online and on SF, but haven't found a suitable solution.

    Here is my ntpq -pn output:

       remote           refid      st t when poll reach   delay   offset  jitter
    =============================================================================
     122.226.192.4   66.220.9.122     2 u   30   64    3   53.734  146507. 127822.
     120-88-46-10.sn 158.43.128.33    2 u   33   64    3  150.373  12823.5 127821.
     suisho.attritio 133.100.9.2      2 u   29   64    3   34.351  148556. 133910.
     123.146.124.27  61.153.197.226   3 u   27   64    3   21.123  152572. 133909.
     114.80.81.1     204.152.184.72   2 u   29   64    3   55.605  148520. 129851.
    

    As of now my 'hwclock' says:

    Fri 25 Mar 2011 03:27:06 PM CST -0.048504 seconds

    My 'date' says:

    Fri Mar 25 15:21:17 CST 2011

    They are off by about 6 minutes and I just did an ntpdate -u about 10 minutes ago...

    Also, I'm currently running Centos 5.5 32-bit with kernel 2.6.18-194.32.1.el5

    What should I do to fix the system clock? The hardware clock seems to be working fine.

    EDIT: Added the new values in my kernel boot line as described by Sacx. Though the delay is a lot better after reboot, but after 16 hours the time is still slow by 35 minutes. Just checked my current_clocksource and it says tsc still. I tried changing it to acpi_pm but it doesn't work. Looking at my available_clocksource, it shows: jiffies tsc pit

    • Marcela Lozano
      Marcela Lozano about 13 years
      This is a physical machine or virtual?
    • samxli
      samxli about 13 years
      I'm using a cloud computing service.
    • Albin
      Albin over 12 years
      hi samxli what else o what other parameters did you configure? these ones notsc divider=10 clocksource=acpi_pm any other? what your OS red hat 5.5 x64?
  • samxli
    samxli about 13 years
    This seems to be a viable solution so far. The system clock hasn't had any noticeable drift yet. I will wait until tomorrow to see if everything stays normal; then come back and pick your answer as the correct answer :) Thanks!
  • samxli
    samxli about 13 years
    It's been 16 hours and the time drifted about 35 minutes. NTP still has not synced with any of the servers. My current /sys/devices/system/clocksource/clocksource0/current_clockso‌​urce shows tsc.
  • samxli
    samxli about 13 years
    finally got it working after tweaking some more parameters in the boot line :)
  • insaner
    insaner over 6 years
    @samxli how come you didn't post what those parameters were? I've been trying to find a solution to clock drift for a long time now, and still nothing has worked. fc17-32bit