Time problems!


#1

my server’s time keeps getting out of whack. occasionally - I’d say once every couple months - it’ll jump ahead or behind hours, days, or sometimes months. ntpd doesn’t seem to be keeping things in sync. Since this first happened last Thanksgiving, DreamHost has been unable to fix the problem :expressionless: It happened again a couple days ago, and I submitted a ticket, but haven’t heard a reply yet, so I started to muck around on-line to look for time-based commands and see if I could at least confirm if this was a hardware or software problem, since DH keeps insisting it was hardware, but I was not convinced.

I learned today that Linux keeps time separately from the hardware. I never knew that. Apparently Linux only checks up on the hardware time upon shut down and start up. This turned out to be handy in diagnosing the problem:

/sbin/hwclock -r

reports the time that the computer hardware has, and it reported that the hardware clock is on-time. well, it’s actually 5 minutes ahead, but not a week behind, as the linux clock:

date

proved to be. I used hwclock --hctosys to copy the hardware time to the OS time. this was fine and well for about 15 minutes, after which point the OS now reports a time about 1 and a half hours in the future, while the hardware clock is still reporting the real (5 minute-off >_>) time.

When this problem first came up, DreamHost attempted to solve it by moving to new hardware. Since it continued, I knew it was unlikely hardware, but DH insisted that this kind of problem was not uncommon (which I didn’t buy :P), and attempted to solve the problem by increasing the frequency of ntpd syncs. This never solved the problem, and I’ve complained about it with the only effect being yet another increase in ntpd sync frequency.

I tried to look at the options for the ntpd program by running:

ntpd --help

but I’m told “command not found”… I find it hard to believe that ntpd isn’t installed, so I poked around on-line to see if maybe I needed to also specify a path. I couldn’t find anything, but I did noted, on wikipedia, that there should be a /var/log/ntp.log file. This file does not seem to exist on my server. Is it possible I really don’t have ntpd? Even if I don’t, however, that does not explain to me why the server time is jumping around like this.

I’m hoping someone else has some ideas about what’s causing this. My Linux knowledge is very far from complete - when it comes to command-lines, I still love DOS :slight_smile: - and so I’m sure I’m missing some basic information that might help me figure out this stupid problem once and for all. Logs I can check, other useful programs, etc.

Thanks for any help.


#2

in the time it took to write all that, the OS time has jumped to be about 10 and a half hours behind >_>

[edit] for the curious: http://www.psypets.net/timetest.php


#3

What you are describing would drive me nuts, and would have to make any “time based” programming a miserable experience (even relying upon cron!).

I have no personal experience, or knowledge, that is likely to be of help - your research into the issue is much more complete than mine. You are not alone, however, in trying to deal with time flakiness; there are several threads on these forums with similar issues. :wink:

You might try politely asking support to forward this issue “up the food chain”, along with your support history and the information in this post, to the “next level” of support, or directly to the system administrators.

This issue really does deserve a “real” answer, and I’m very interested to see what other can share about this and how you ultimately get it resolved.

Great Posts!

–rlparker


#4

My “inquiry has been moved to the queue of a specific tech support team member”, whoever that may be. I’ll definitely post the solution here, if one comes. If one doesn’t, I’ll really have to find another host. These problems completely muck up my site, and I end up spending hours restoring from backups and then fixing for the time “missed” since that backup point. It’s sad - DreamHost is overall so good at things. It seems like keeping time would be a relatively simple issue.