View Full Version : Time on VPS slow
bladex
03-07-2006, 09:24 PM
Hi ... I'm having a strange time problem on my VPS. It's consistently 5 minutes slow even using NTP. If I set the correct time by hand with "date hhmmMMDDYEAR", NTP resets it back to 5 minutes slow right away.
All my desktop machines locally all use NTP as well, and they are correct.
Any ideas?
thanks -
Rob
Pullings
03-08-2006, 10:38 AM
I'm having exactly the same problem:
# ntpdate pool.ntp.org
8 Mar 10:28:24 ntpdate[8198]: step time server 128.10.252.10 offset 361.382934 sec
# ntpdate pool.ntp.org
8 Mar 10:28:52 ntpdate[8199]: step time server 217.160.252.91 offset 361.389089 sec
Notice the offset is still at 361 seconds, even after setting the time with ntpdate. Weird!
David
justin
03-28-2006, 03:28 AM
I've noticed it as well, only mine is always two minutes fast:
# ntpdate -v pool.ntp.org
27 Mar 20:26:31 ntpdate[2988]: ntpdate 4.2.0a@1.1190-r Sun Mar 6 12:28:22 EST 2005 (1)
27 Mar 20:26:32 ntpdate[2988]: step time server 207.210.77.32 offset -114.979492 sec
# ntpdate -v pool.ntp.org
27 Mar 20:26:35 ntpdate[2989]: ntpdate 4.2.0a@1.1190-r Sun Mar 6 12:28:22 EST 2005 (1)
27 Mar 20:26:35 ntpdate[2989]: step time server 207.210.77.32 offset -114.979661 sec
That's pretty bizzare. My guess would be the vps's must use the host system's local clock, and it must be a bit wrong on some of them. Pretty annoying.
rjharrison
04-01-2006, 07:43 AM
This is the reason for the problem and a solution.
Hi.
In Xen the user VPS' clocks should be tied to the host server's clock. This is typically what you'd want. Since we run ntp on the host servers to keep their time accurate.
e.g.:
# VPS time is locked to the host server's time and cannot be changed.
[root@rjharrison ~]# date --set 20050101
Sat Jan 1 00:00:00 EST 2005
[root@rjharrison ~]# date
Sun Mar 26 03:04:05 EST 2006
The version of Xen we are using has some kind of a time drift issue. So you may want to a time on your VPS independant of the host server.
To do that run:
# set independent_wallclock
[root@rjharrison ~]# echo 1 > /proc/sys/xen/independent_wallclock
(You can put that in your startup scripts if you wish. e.g. at /etc/rc.local on redhat distros).
The VPS date can now be set.
# now the date is set as expected
[root@rjharrison ~]# date --set 20050101
Sat Jan 1 00:00:00 EST 2005
[root@rjharrison ~]# date
Sat Jan 1 00:00:01 EST 2005
# e.g. so you can use ntpdate
[root@rjharrison ~]# ntpdate 0.pool.ntp.org
26 Mar 03:17:43 ntpdate[1614]: step time server 81.171.100.41 offset 38805449.236315 sec
[root@rjharrison ~]# date
Sun Mar 26 03:17:46 EST 2006
There is a Xen update coming out 'shortly' with a fix that stops the VPS time drifting. After we upgrade your VPS next (we'll tell you in advance) you'll then be able to remove that independent_wallclock setting.
Regards, Peter
http://rimuhosting.com
netnichols
06-23-2007, 09:45 AM
First off, I have to complain a bit about the process of posting a message here. You'd think the smart guys that run rimuhosting could offer a universal login for both the control panel and the forums. Instead, I had to wait 3 days for my 'forum account' to be activated. Rimu has been GREAT for me so far... but that's pretty pathetic.
Now, to the main point...
This is a pretty obscure fix especially when one considers the howto article about NTP:
http://rimuhosting.com/howto/ntp.jsp
Information about how one cannot change their VPS's time (manually or with ntpd) without running a special command should definitely be included in that page. Also a note about the Xen bug would sure be nice. I spent a few hours trying to figure out this problem, which would have only been a few minutes if the howto article would have been accurate.
Now back to working with my otherwise awesome Rimu VPS.
netnichols
06-25-2007, 09:59 AM
Some follup info...
For a more permanant fix one can do the following:
add xen.independent_wallclock = 1 to the VM’s /etc/sysctl.conf
This negates the need to create any startup scripts.
See the following for more information:
http://www.minimizr.com/blog/2006/10/minimal-how-to-setup-vps-server/
http://www.novell.com/documentation/vmserver/index.html?page=/documentation/vmserver/vm_server_admin/data/b5q74jb.html
I've tried it on my VM and everything seems to work as expected.
jgbillings
06-28-2007, 02:21 AM
First off, I have to complain a bit about the process of posting a message here. You'd think the smart guys that run rimuhosting could offer a universal login for both the control panel and the forums. Instead, I had to wait 3 days for my 'forum account' to be activated. Rimu has been GREAT for me so far... but that's pretty pathetic.
I had wondered why Peter started directing these forum account activations to the support inbox. Don't think these will take 3 days any longer :)
vBulletin® v3.7.1, Copyright ©2000-2009, Jelsoft Enterprises Ltd.