I am seeing a very severe clock drift on my Xen HVM VPS, rented from a hosting provider, so I don't have access to the dom0 system. I continuously run ntpd, but the clock drifts by as much as 30 seconds in 5 minutes and NTP cannot keep up. Has anyone experienced this?

Here are some details:

$ dmesg | grep clock
[    0.160000] Measured 347 cycles TSC warp between CPUs, turning off TSC clock.
[    0.396000] * this clock source is slow. Consider trying other clock sources
[    0.550448] Switching to clocksource acpi_pm
[    0.653135] rtc_cmos 00:05: setting system clock to 2011-03-09
02:45:40 UTC (1299638740)

$ cat /sys/devices/system/clocksource/clocksource0/available_clocksource 
acpi_pm

$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource 
acpi_pm
link|improve this question
You could use the tinker panic 0, and tinker step options in your ntp.conf. This will allow it to make corrections faster. Not sure what you need to do to fix the real problem though. – Zoredache Mar 9 '11 at 21:24
feedback

2 Answers

In your /etc/sysctl.conf try setting:

xen.independent_wallclock = 1

(inside the domUs)

NB: you can set the variable on a running system using the sysctl command, too. I.e. no reboot for the domU needed.

link|improve this answer
1  
From what I understand that option does nothing on HVM guests (it only applies to PV ones). – ipartola Mar 9 '11 at 21:21
@ipartola: I see. Never mind in that case. – STATUS_ACCESS_DENIED Mar 11 '11 at 17:00
feedback

Add this line to the beginning of ntpd.conf:

tinker panic 0

That will help it keep up. Here is a link to the vmware best practices for timekeeping. I know you're not using vmware, but much of it should still be applicable.

link|improve this answer
For whatever reason that doesn't work: Restarting openntpd: /etc/openntpd/ntpd.conf:16: syntax error Which is the line on which I added tinker panic 0. I am using openntpd 3.9p1+debian-5 on Ubuntu 10.10 2.6.35-22-generic-pae i686. – ipartola Mar 9 '11 at 21:35
I missed the part about openntpd. Losing ticks is common (and nearly unavoidable) in a virtual world. You're going to need to get ntp to keep up somehow. Can you run "regular" ntpd on the box? – Chris Mar 9 '11 at 21:50
Yes, I installed ntp instead of openntpd and added the "tinker panic 0" line to the config file; then restarted ntpd. So far the time has not changed. – ipartola Mar 9 '11 at 22:41
By "not changed" do you mean in the good way or the bad way? – Chris Mar 10 '11 at 15:23
Sorry for the confusion. I mean in a bad way: as in the time is still wrong. – ipartola Mar 23 '11 at 15:42
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.