Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Clock runs slow when I leave iMac on all the time

My clock has been running slow lately. Previously, I never had a problem. Two things changed, one of which is causing it:


1) I am now running Mavericks

2) I leave my computer turned on and set to never sleep the CPU so that I can mine cryptocurrency.


Yes, I have "Set date and time automatically" checkmarked (enabled). But when I notice my iMac's clock is off, I open Date & Time, then untick and then tick that checkbox, and then the time gets set correctly.


So something is preventing the date/time server from automatically updating my clock. It's currently set to Apple Asia because I am in Japan now. And I know that server works fine because, like I said, it works right away when I manually remove and then put back that check mark. But why is it not happening automatically?


Again, the only two things that have changes are that I am now running Mavericks and I leave my computer running (never sleeping) all the time.


Any ideas?


Thank you.

iMac, OS X Mavericks (10.9.1), March 2009 DuoCore, 8GB RAM, 1TB HD

Posted on Jan 22, 2014 7:08 PM

Reply
Question marked as Best reply

Posted on Jan 26, 2014 5:21 PM

I have had a similar problem, the clock was running slow on a Mavericks MacBook Pro I look after. After trying out several leads, one solution that worked was to change the value of the "Set date and time automatically" field in the System Preferences -> Date & Time -> "Date & Time" tab. Editing the text in the field from (in my case) "Apple Europe (time.euro.apple.com.)" to "time.euro.apple.com" fixed the problem for me.


It appears that the text in this field gets written almost verbatim into the /etc/ntp.conf file, which is then used to look up the time servers. Not only does "time.euro.apple.com." lead nowhere (due to the trailing "."), but Mavericks will even add "Apple" and "Europe" into the file. The end result is the time system appears unable to get a time fix, and so the clock time drifts, uncorrected.


If you are in Japan, you might want to try "time.asia.apple.com" in that field. The key thing is to avoid the trailing ".". Just change the text in the field an close window.


I should add that this wasn't the only step I took to debug my slow clock issue. Other steps included deleting and re-creating the /etc/ntp.conf file and exploring the "pacemaker" process. However, I don't think these steps were necessary in the end and simply adjusting the text in the field above should suffice. I could be wrong.


Needless to say you might have a different issue and this might not help. Good luck!


Tim

30 replies

Feb 4, 2014 2:45 AM in response to JDW1

Apologies, somehow I missed your previous note about the reboot. Sorry to hear it's not working out still. I've been taking a look at the other steps I took in the previous case. I'm trying to reproduce the steps on another machine so that I can offer a clean solution for all of us. When I have something to try I'll post again. Best, Tim

Feb 4, 2014 3:22 AM in response to Tim Jervis

I'm sorry not to have something more grounded in logic, but the following worked for me.


I managed to reproduce the result where pacemaker showed no updates in the residue value, by changing the contents of the /var/db/ntp.drift file to either of 0, 1, -100 and -10. I then set it to the previous value, -25.686 in my case, and the residue value resumed the changes that I was expecting to see. This "magic number" is unsatisfactory of course and almost certain not to work on another machine, but for now all I can suggest is a set of small changes around that number to see if that kicks it into shape.


I've seen other postings about replacing the ntpd altogether, I have no reason to doubt they would work in the right context.



To reset the /var/db/ntp.drift file, do the following:

cd Desktop

mkdir time-fix

cd time-fix

cp /var/db/ntp.drift ntp.drift.backup

echo ‘-25.686' > ntp.drift

sudo cp ntp.drift /var/db/ntp.drift

sudo killall ntpd

sudo killall pacemaker

sudo /usr/libexec/pacemaker -v

as before, this makes a backup of the file in a folder on the desktop, creates the replacement file and copies it into place. The killall commands restart the ntpd and pacemaker processes to ensure the file is re-read, although they might not be necessary in all cases.


The output I would hope to see would show a changing residue, e.g.:


Oxygen:~ timjervis$ sudo /usr/libexec/pacemaker -v

Feb 4 11:02:14 Oxygen.local pacemaker[835] <Info>: power status check: using external power

Feb 4 11:02:14 Oxygen.local pacemaker[835] <Info>: created file monitor for /var/db/ntp.drift

Feb 4 11:02:14 Oxygen.local pacemaker[835] <Info>: interval = 1 seconds, tolerance = 0.000000, drift = -25.686000

Feb 4 11:02:14 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue 0.000000 delta -25

Feb 4 11:02:15 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.686000 delta -26

Feb 4 11:02:16 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.372000 delta -26

Feb 4 11:02:17 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.058000 delta -25

Feb 4 11:02:18 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.744000 delta -26

Feb 4 11:02:19 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.430000 delta -26

Feb 4 11:02:20 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.116000 delta -25

Feb 4 11:02:21 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.802000 delta -26

Feb 4 11:02:22 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.488000 delta -26

Feb 4 11:02:23 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.174000 delta -25

Feb 4 11:02:24 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.860000 delta -26

Feb 4 11:02:25 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.546000 delta -26

Feb 4 11:02:26 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.232000 delta -25

Feb 4 11:02:27 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.918000 delta -26

Feb 4 11:02:28 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.604000 delta -26

Feb 4 11:02:29 Oxygen.local pacemaker[835] <Debug>: drift -25.686000 residue -0.290000 delta -25




Aside from trying a few different values for the ntp.drift file, I don't have much more to contribute I'm afraid. I tried a few alternative ways of setting the file contents, but they didn't work out (e.g. ntpdate -q time.apple.com, ntpd -q). Replacing the whole of ntpd might do it, but I tried to avoid that myself as I didn't want to be too far off Apple's canonical software base in case it caused problems with future updates.


Good luck!


Tim

Feb 4, 2014 4:57 PM in response to Tim Jervis

Tim,


Thank you for your help. I gave your tip a try and not Edumara's simply because I don't have the 10.8 installer handy to implement Edumara's advice.


But there seems to be a problem with your advice, Tim. I tried everything you said, line by line, but when I typed the "echo" line, the text cursor shot to the left and followed a ">" character. Have a look:


James-iMac:~ james$ cd Desktop

James-iMac:Desktop james$ mkdir time-fix

James-iMac:Desktop james$ cd time-fix

James-iMac:time-fix james$ cp /var/db/ntp.drift ntp.drift.backup

James-iMac:time-fix james$ echo ‘-25.686' > ntp.drift

> sudo cp ntp.drift /var/db/ntp.drift

> sudo killall ntpd

> sudo killall pacemaker

> sudo /usr/libexec/pacemaker -v

> (text cursor just sits here)


Please advise.


(Sorry for my need of your hand-holding, but I am really Terminal Dummy!)

Feb 4, 2014 5:05 PM in response to JDW1

Hi - Looks like one of the quotes around '-25.686' is the wrong type, so the system is waiting for you to close an open quote. Type ctrl-C to cancel what you have in the Terminal, and from the standard standard prompt, try again with this:


cd Desktop

mkdir time-fix

cd time-fix

cp /var/db/ntp.drift ntp.drift.backup

echo '-25.686' > ntp.drift

sudo cp ntp.drift /var/db/ntp.drift

sudo killall ntpd

sudo killall pacemaker

sudo /usr/libexec/pacemaker -v

Feb 4, 2014 5:15 PM in response to Tim Jervis

Edumara, your tip is well noted. Should Tim's trick not work, I will resort to digging up the 10.8 installer and giving your advice a try. But for now, the Terminal is much more handy! :-)


Tim, here's what I did in the Terminal just now:


James-iMac:~ james$ cd Desktop

James-iMac:Desktop james$ mkdir time-fix

James-iMac:Desktop james$ cd time-fix

James-iMac:time-fix james$ cp /var/db/ntp.drift ntp.drift.backup

James-iMac:time-fix james$ echo '-25.686' > ntp.drift

James-iMac:time-fix james$ sudo cp ntp.drift /var/db/ntp.drift

Password:

James-iMac:time-fix james$ sudo killall ntpd

James-iMac:time-fix james$ sudo killall pacemaker

James-iMac:time-fix james$ sudo /usr/libexec/pacemaker -v

Feb 5 10:10:24 James-iMac.local pacemaker[70912] <Info>: power status check: using external power

Feb 5 10:10:24 James-iMac.local pacemaker[70912] <Info>: created file monitor for /var/db/ntp.drift

Feb 5 10:10:24 James-iMac.local pacemaker[70912] <Info>: interval = 1 seconds, tolerance = 0.000000, drift = -25.686000

Feb 5 10:10:25 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue 0.000000 delta -25

Feb 5 10:10:26 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.686000 delta -26

Feb 5 10:10:27 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.372000 delta -26

Feb 5 10:10:28 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.058000 delta -25

Feb 5 10:10:29 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.744000 delta -26

Feb 5 10:10:29 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.430000 delta -26

Feb 5 10:10:31 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.116000 delta -25

Feb 5 10:10:32 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.802000 delta -26

Feb 5 10:10:33 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.488000 delta -26

Feb 5 10:10:34 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.174000 delta -25

Feb 5 10:10:35 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.860000 delta -26

Feb 5 10:10:36 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.546000 delta -26

Feb 5 10:10:37 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.232000 delta -25

Feb 5 10:10:38 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.918000 delta -26

Feb 5 10:10:39 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.604000 delta -26

Feb 5 10:10:40 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.290000 delta -25

Feb 5 10:10:41 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.976000 delta -26

Feb 5 10:10:42 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.662000 delta -26

Feb 5 10:10:43 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.348000 delta -26

Feb 5 10:10:44 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.034000 delta -25

Feb 5 10:10:45 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.720000 delta -26

Feb 5 10:10:46 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.406000 delta -26

Feb 5 10:10:47 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.092000 delta -25

Feb 5 10:10:48 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.778000 delta -26

Feb 5 10:10:49 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.464000 delta -26

Feb 5 10:10:50 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.150000 delta -25

Feb 5 10:10:51 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.836000 delta -26

Feb 5 10:10:52 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.522000 delta -26

Feb 5 10:10:53 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.208000 delta -25

Feb 5 10:10:54 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.894000 delta -26

Feb 5 10:10:55 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.580000 delta -26

Feb 5 10:10:55 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.266000 delta -25

Feb 5 10:10:57 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.952000 delta -26

Feb 5 10:10:58 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.638000 delta -26

Feb 5 10:10:59 James-iMac.local pacemaker[70912] <Debug>: drift -25.686000 residue -0.324000 delta -26

^CJames-iMac:time-fix james$


So at this point, I guess I just need to give it a few days and then see if there is any drift.


In the meantime, I am baffled by all this. It makes no sense whatsoever why my advanced iMac's clock (way more advanced than a regular clock) should drift so badly in the first place. I mean really. Losing 5 minutes in about a week's time? That's some serious drift!

Feb 4, 2014 5:31 PM in response to JDW1

Hi everyone -


I agree it's crazy, and that switching out the ntpd is one solution. I understand at least part of the reason for the change in Mavericks is to reduce energy consumption, which sounds like a good motive - but not to the extent of breaking the clock, of course, if that is what it has done.


James - in my experience of this issue and based on your latest output, it looks good to go for now. You should be able to tell after a day if the clock has drifted. You should also expect the drift value to change occasionally, if you run the pacemaker line in Terminal again. e.g. in the last 18 hours or so, mine changed from -25.686 to 2.919.


BTW if your clock is "corrected" with poor parameters that aren't being updated by a time server, it's not too surprising that it drifts by 5 minutes in a week.


Perhaps in the upcoming 10.9.2 update, there will be a tweak for the clock that will normalise things.

Feb 10, 2014 3:58 PM in response to Tim Jervis

Dear Tim,


Although replacing ntpd had actually solved my problem, about 15 hours ago I decided to try your solution. Much to my surprise, it works. My conclusion is that the crucial part is the creation of a brand-new ntpd.drift via the command


echo '-25.686' > ntp.drift


thereafter placing ntp.drift in the relevant folder. I'm forced to conclude that my original ntp.drift had somehow become corrupted (although the corruption only seemed to affect the Mavericks version of ntpd, not its Mountain Lion counterpart). Be that as it may, thank you so much. Naturally, I've restored the Mavericks version of ntpd.

Feb 13, 2014 8:57 AM in response to Tim Jervis

Tim, I'm sorry to have to report that the supposed fix of Mavericks clock was only a mirage or, rather, a temporary one. It was all right for over two days, but on the third the clock was again slow by several seconds. After manually causing the clock to syncrhonise, I've noticed the clock remains steady and reliable for several hours, but then it starts drifting again, until it is again synchronised, remaining again stable for several hours and so on. I wonder if it may go nuts in periods of inactivity or something. For now, it seems that using the Mountain Lion ntpd is much more reliable than simply creating a new drift file.


Any ideas?

Oct 16, 2014 10:10 AM in response to Edumara

I am using a 2012 mac mini and my clock was running fast since I updated to mavericks(10.9.5). Tried all the resets. Another page suggested starting safe mode. Tried all that. The clock on my mini was running fast, a second per hour or more.


The culprit for me seems to be a utility I installed called FanControl. I think it was competing with mavericks or something. It was generating an error message every 5s. After removing it, the clock seems to be keeping time bang on.


Procedure to eliminate FanControl

Open terminal and seach for FanControl:

$ ps -ef | grep -i fan

0 145 1 0 Gio12am ?? 3:58.07 /Library/StartupItems/FanControlDaemon/FanControlDaemon run


This tell me that I really have the FanControlDaemon running as pid 145.


Then I eliminate it :


$ cd /Library/StartupItems/

$ sudo rm -Rf FanControlDaemon/


and then kill the daemon:


$ sudo kill 145


WARNING: if you replicate this procedure the you have to use the PID you get from ps -ef instead of 145 !!! This number will surelly be different on your system.



Re: Error coming up in Console every 5 seconds

Clock runs slow when I leave iMac on all the time

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.