NTP issues and system time drift
Rather than repost everything:
http://ubuntuforums.org/showthread.php?t=1793516 I updated the thread there today. It seems as though, from what I have read, that there may be another app/tool that is tinking with the time other than NTPD? from yesterday checking HWclock against system time after doing a ntpdate sync and starting NTPD again it would slowly creep ahead, but never more than 5 seconds Code:
Thu 01 Dec 2011 01:22:22 PM PST -0.665057 seconds Code:
Thu 01 Dec 2011 01:28:26 PM PST -0.529493 seconds Code:
Fri 02 Dec 2011 08:49:05 AM PST -0.417030 seconds Any help is appreciated. |
You might want to check the battery if it's an older box (the hardware clock runs from the battery and if the battery is low, dead or whatever...). This will be a problem if the system is turned off between sessions.
Another thing you might want to look into is the hwclock utility, the section on --adjust and the section The Adjust Function about line 280-ish in the manual page. You can "walk" the adjustment (carefully! a little at a time) to bring the hardware clock in sync with the system clock. Additionally, look at the drift file in /etc/ntp. There should be a floating-point number there; if /etc/ntp/drift does not exist, do something like this Code:
echo 0.0 > /etc/ntp/drift Of course, if your NTP stuff isn't in /etc/ntp, adjust the above to where it actually lives. Hope this helps some. |
From your other post it appears that you are polling the desired timer server. I never saw it synched i.e. the * before the server name in the output of the ntpq -p command. If you zero out the drift file it will take 900s or so for ntp to perform its inital calibration.
The hardware clock is not very accurate and I believe that if the system clock is synched via ntp it will be updated every 11 minutes. |
Doesn't the hwckock cmd tell me the hardware time? That is actually acurate.
|
Quote:
When you're in sync, running ntpq -p will show something like this: Code:
/usr/sbin/ntpq -p So, take a look at your /etc/ntp.conf and perhaps try this: Code:
server 127.127.1.0 # local clock The three pool servers allow NTP to synchronize to the best electrically close external server; I use three US pool servers -- if you're not in the US, you can choose from pool servers in your area or simply Code:
server 127.127.1.0 # local clock Hope this helps some. |
Ditch NTP altogether and use clockspeed?
|
The only purpose of the hardware clock is to provide a time source for the system clock when the computer is powered on. The hardware clock and system clock are independent of each other. The hardware drift correction is stored in /etc/adjtime and the system clock correction is stored in the ntp driftfile.
http://www.ntp.org/ntpfaq/NTP-s-sw-clocks-quality.htm Have you made any recent changes to your system? |
To be clear. I don't expect my system to sync to the hw clock. If I reboot system syncs to the hw clock correctly. I hardly reboot so drift happens when on. I reboot maybe once q month. If that.
[Quite] Have you made any recent changes to your system?[/QUOTE] This has been going on for months Ill try some of things suggested above next time I remote in. Thanks for the tips so far. Ill repoet back. |
Code:
ntpq -p What SHOULD the drift file have? x.xxx, but previously my drift file was something like -10.197. Should it be a negative number? After making the changes (i reverted the drive file to -10.197 it was a few days ago, and adding back the ntp pool servers to the conf file), stopping and starting NTP... My system time is synced and OK. BOTH these times are very very very close to my Win7 machine. I'll see what happens the remainder of the day and check, and check times again in the AM. Code:
sudo hwclock;date |
Wait until the value of reach becomes 377 and post the output of ntpq -p again. Hopefully your system will show that it is synced to a time server.
Yes, it can be a negative number. Depends if your system clock runs fast or slow. |
Code:
hwclock;date |
The output does not show your computer locked to a time server i.e. (*).
You restarted ntp but output does not show your local (fudge) clock. Your offset has decreased from ~171 seconds to ~7 so something is happening... Just to verify this is not a virtual machine? |
Correct, its not a VM.
|
So why is it not locking to a server?
|
What type of computer desktop or laptop?
Can its clock speed vary? If so try disabling it. And you could try disabling apic. http://www.math.ucla.edu/~jimc/docum...wont-sync.html |
All times are GMT -5. The time now is 05:26 AM. |