Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
 Post subject: System time drift
PostPosted: Thu Aug 07, 2003 10:02 pm 
Offline
Senior Member

Joined: Sun Jul 20, 2003 8:29 am
Posts: 100
Website: http://www.ipo-australia.com
Location: Tropical Queensland, Australia
My linode is losing about 15 seconds per day. I run cron jobs at various times and need reasonable accuracy for my end users.

I'm not sure whether time has been "virtualised" with UML. Can system time be synchronised at least one per day?


Top
   
 Post subject:
PostPosted: Thu Aug 07, 2003 10:45 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Interesting -- I'll ask Jeff (creator of UML) about it.

I believe your Linode gets the initial time from the host at each boot. But, I think it acts like a software clock from there.

Are you running ntp? You're able to change/set the time when ever you need to.

-Chris


Top
   
 Post subject:
PostPosted: Fri Aug 08, 2003 9:06 am 
Offline
Senior Member

Joined: Sun Jul 20, 2003 8:29 am
Posts: 100
Website: http://www.ipo-australia.com
Location: Tropical Queensland, Australia
It looks like the date has been "virtualised" as I can set it with the 'date' command.

I can't seem to get rdate to work - 'rdate -p ntp.nasa.gov' gives 'No route to host'.

But the following Perl script works on the small Redhat distro - it uses UDP on port 123 to get the time from an ntp server
http://www.kloth.net/software/sntp.htm


Top
   
 Post subject:
PostPosted: Fri Aug 08, 2003 4:15 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Does this work for you:

Code:
/usr/sbin/ntpdate -s -b -p 8 clock.redhat.com


-Chris


Top
   
 Post subject:
PostPosted: Mon Aug 11, 2003 11:52 am 
Offline
Senior Member

Joined: Sat Jun 28, 2003 12:02 am
Posts: 66
Website: http://kenny.aust.in
caker wrote:
I believe your Linode gets the initial time from the host at each boot. But, I think it acts like a software clock from there.


$ ./sntpclock `dnsip ntp2.kansas.net` | ./clockview
before: 2003-08-11 11:31:54.395679000000000000
after: 2003-08-11 11:33:16.993675980730354785
$ uptime
11:32:10 up 16 days, 6:09, 1 user, load average: 0.07, 0.02, 0.00

$ ./sntpclock `dnsip ntp2.kansas.net` | ./clockview && echo && ./sntpclock `dnsip clock.redhat.com` | ./clockview
before: 2003-08-11 11:39:29.600608000000000000
after: 2003-08-11 11:40:52.257771671075329184

before: 2003-08-11 11:39:30.094399000000000000
after: 2003-08-11 11:40:52.750950499869413673

Before then after a reboot. The clock on my linode seems consistent, just looks like host2's clock is off by 82 seconds. Of course, if it really bothered me that much I could just change the time on my linode :)

Kenny


Top
   
 Post subject: dealing with drift
PostPosted: Fri Aug 15, 2003 2:19 pm 
Offline
Senior Member
User avatar

Joined: Fri Aug 15, 2003 2:15 pm
Posts: 111
Website: http://fubegra.net/
I ended up installing ntpd on my Debian system, and it has worked well for keeping the clock up-to-date.

Are there any plans for an ntp.linode.com server, so I don't have to burden the public servers that I'm using?

_________________
Bus error (passengers dumped)


Top
   
 Post subject:
PostPosted: Tue Sep 09, 2003 1:06 pm 
Offline
Junior Member

Joined: Tue Sep 09, 2003 11:59 am
Posts: 47
Website: http://blog.griffinn.org/
I'm also running ntpd on my system.

Now when my system isn't busy idling (:shock:), it's knocking 250ms off the clock. This happens about every half an hour, and the syslog is dominated by lines like these:
Code:
Sep  9 20:17:07 quotable ntpd[4324]: time reset -0.274347 s
Sep  9 20:17:07 quotable ntpd[4324]: synchronisation lost
Sep  9 20:29:43 quotable -- MARK --
Sep  9 20:50:32 quotable -- MARK --
Sep  9 20:53:49 quotable ntpd[4324]: time reset -0.271359 s
Sep  9 20:53:49 quotable ntpd[4324]: synchronisation lost
Sep  9 21:11:21 quotable -- MARK --
Sep  9 21:28:34 quotable ntpd[4324]: time reset -0.262755 s
Sep  9 21:28:34 quotable ntpd[4324]: synchronisation lost
Sep  9 21:52:59 quotable -- MARK --
Is it normal for UMLs to be losing time at this rate?


Top
   
 Post subject:
PostPosted: Tue Sep 09, 2003 5:55 pm 
Offline
Senior Member

Joined: Sat Jun 28, 2003 12:02 am
Posts: 66
Website: http://kenny.aust.in
griffinn wrote:
Is it normal for UMLs to be losing time at this rate?


Mine does.
Code:
$ uptime; sntpclock `dnsip ntp2.kansas.net` | clockview
17:08:16  up  6:00,  1 user,  load average: 0.00, 0.00, 0.00
before: 2003-09-03 17:08:17.082964000000000000
after:  2003-09-03 17:08:20.034561662591069936
------
 17:37:06  up  6:27,  1 user,  load average: 0.08, 0.02, 0.01
before: 2003-09-03 17:37:07.275384000000000000
after:  2003-09-03 17:37:10.452421301536075770
------
 12:44:15  up 1 day, 23:40,  2 users,  load average: 0.00, 0.00, 0.00
before: 2003-09-05 12:44:16.433667000000000000
after:  2003-09-05 12:44:39.748888432488374411


I really didn't want to run ntpd on my host (ntpd just.. doesn't make me feel good [i haven't checked out xntpd]) and even if clockspeed would have ran, I figured it would've have made matters much worse as it depends on a "persistently fast or slow system clock". I ended up just writing a script that will correct the clock if it is beind. It runs from cron every half hour and one fourth second :)

Am I right that the reason this happens is because the linodes keep their own system time with a software clock?


kenny


Top
   
 Post subject:
PostPosted: Tue Sep 09, 2003 8:35 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
Looking through the UML source code, I discovered I was wrong about how UML manages time. It uses an offset from the host's time (it looks like it calls gettimeofday and then addes the UML instance's offset).

I'm now looking towards the host clock being the problem. I'm gathering some stats and will update here when I know more.

-Chris


Top
   
 Post subject:
PostPosted: Tue Sep 09, 2003 9:34 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
The host servers are now running ntpd, instead of just random ntpdate calls. That should take care of the issue.

You shouldn't have to run ntp inside your Linode after this change, that is unless you don't trust the host or want more accuracy than the small drift between updates.

Let me know if this doesn't fix stuff.

-Chris


Top
   
 Post subject:
PostPosted: Sat Sep 13, 2003 11:39 am 
Offline
Junior Member

Joined: Tue Sep 09, 2003 11:59 am
Posts: 47
Website: http://blog.griffinn.org/
Is host8 on ntpd as well? It seems to be wandering slowly away from standard time.

This is from the loop statistics of my own ntpd (the drift is in bold typeface):
Quote:
/var/log# tail /var/log/ntpstats/loopstats
52895 46106.754 -0.038863605 -144.585876 0.104009832 0.160633 10
52895 47174.324 -0.038772777 -144.740128 0.090075165 0.159062 10
52895 48241.944 -0.039523241 -144.897217 0.078009961 0.158571 10
52895 49309.072 -0.038642227 -145.050949 0.067558847 0.157375 10
52895 50378.011 -0.038547661 -145.204453 0.058508554 0.156416 10
52895 51443.890 -0.038467393 -145.357056 0.050671176 0.155472 10
52895 52508.401 -0.063237113 -145.607941 0.081335723 0.184023 10
52895 53574.480 -0.037678500 -145.757553 0.086903767 0.176052 10
52895 54641.989 -0.037389614 -145.906174 0.075261333 0.169611 10
52895 55708.458 -0.037382787 -146.054764 0.065178368 0.164607 10


Top
   
 Post subject:
PostPosted: Mon Sep 15, 2003 6:04 pm 
Offline
Linode Staff
User avatar

Joined: Tue Apr 15, 2003 6:24 pm
Posts: 3090
Website: http://www.linode.com/
Location: Galloway, NJ
griffinn wrote:
Is host8 on ntpd as well? It seems to be wandering slowly away from standard time.


Host8 is running ntpd. I can't quite get my head around how ntpd on the host, and ntpd inside UML are going to interact. Perhaps as host8 slowly goes into sync (which it should be by now), your Linode has to compensate?

-Chris


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group