LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-21-2011, 09:06 AM   #1
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Rep: Reputation: 32
NTP behavior


I'm seeing some strange behavior with NTP. Running "ntpq -p" on one of my client systems is showing the following:

root@cc:~# ntpq -p
remote refid st t when poll reach delay offset jitter
==============================================================================
rt-ora1 LOCAL(0) 11 u 136 1024 377 0.544 24155.8 469.994
*LOCAL(0) .LOCL. 12 l 33 64 377 0.000 0.000 0.001

I'm confused about the large offset (24155) that's huge. When I run the date command on the systems there is about a 24 second variation between the NTP server and its client.

I've run NTP on many systems before and have never seen such large offsets. Does anyone have experience with this and any idea why this would happen. I have about 25 clients and all are experiencing much the same results.

Lastly does anyone have experience with NTP running on a VM? I was wondering if putting a server on a VM would be problematic.

Any help will be greatly appreciated.
Thank you
 
Old 01-21-2011, 09:41 AM   #2
z1p
Member
 
Registered: Jan 2011
Location: the right coast of the US
Distribution: Ubuntu 10.04
Posts: 80

Rep: Reputation: 23
From the NTPQ docs:

peers
Obtains a current list peers of the server, along with a summary of each peer's state. Summary information includes the address of the remote peer, the reference ID (0.0.0.0 if this is unknown), the stratum of the remote peer, the type of the peer (local, unicast, multicast or broadcast), when the last packet was received, the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in milliseconds.

Code:
remote refid      st   t   when   poll   re    delay   offset       jitter
==============================================================================
rt-ora1 LOCAL(0)  11   u    136   1024   377   0.544   24155.8     469.994
So, 24155.8 msecs is about 24 secs which matches what you see using date.


As far as using NTP on a VM there should not be any issue there.
 
1 members found this post helpful.
Old 01-21-2011, 09:44 AM   #3
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by z1p View Post
From the NTPQ docs:

peers
Obtains a current list peers of the server, along with a summary of each peer's state. Summary information includes the address of the remote peer, the reference ID (0.0.0.0 if this is unknown), the stratum of the remote peer, the type of the peer (local, unicast, multicast or broadcast), when the last packet was received, the polling interval, in seconds, the reachability register, in octal, and the current estimated delay, offset and dispersion of the peer, all in milliseconds.

Code:
remote refid      st   t   when   poll   re    delay   offset       jitter
==============================================================================
rt-ora1 LOCAL(0)  11   u    136   1024   377   0.544   24155.8     469.994
So, 24155.8 msecs is about 24 secs which matches what you see using date.


As far as using NTP on a VM there should not be any issue there.
There were (are?) known issues with VMware and RedHat. They may have fixed them, but in the past, there were combinations of RHEL and Vmware that would cause the time to drift wildly. You had to not only patch VMware, but also the Linux kernel with a VMware provided patch, to get NTP to work. Otherwise, the clock would drift so bad, the NTP server would die after about an hour.

They MAY have fixed it, but the OP doesn't say what version/distro of Linux or what kind of VM
 
1 members found this post helpful.
Old 01-21-2011, 05:13 PM   #4
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
Thank you for the information, though what I was concerned about is that the offset and time difference between the systems was so large. In the past I've rarely seen an offset greater than 1000, they were generally between 300 and 700. My clients kept close track with the server.

My guess is the clocks on my NTP servers are rather bad and must be fluctuating wildly and the clients can't keep track. Possibly I should look at one of the other systems to act as the server. My previous servers were actual network clocks. I don't have one here and was hoping I picked a fairly accurate system as it was the newest.

For my NTP servers I have
Redhat on a Dell R710, no VMs, running Oracle 10G (picked because it is the newest)
Ubuntu running KVM with the NTP server on a VM on a Dell 2950 (also the DNS server)
 
Old 01-21-2011, 05:48 PM   #5
z1p
Member
 
Registered: Jan 2011
Location: the right coast of the US
Distribution: Ubuntu 10.04
Posts: 80

Rep: Reputation: 23
Quote:
Originally Posted by TB0ne View Post
There were (are?) known issues with VMware and RedHat. They may have fixed them, but in the past, there were combinations of RHEL and Vmware that would cause the time to drift wildly. You had to not only patch VMware, but also the Linux kernel with a VMware provided patch, to get NTP to work. Otherwise, the clock would drift so bad, the NTP server would die after about an hour.

They MAY have fixed it, but the OP doesn't say what version/distro of Linux or what kind of VM
Thanks for setting me and the OP straight. I was not aware of the issues and fortunately have not run into them.


thllgo - sorry for being off the mark with my answer, I misunderstood what you asked. As TBone said there are indeed issue that can occur with NTP and VMs, so that may account for some of your time drift.


regards,
z1p
 
Old 01-23-2011, 08:54 PM   #6
cryingthug
Member
 
Registered: Jun 2009
Posts: 131

Rep: Reputation: 18
radio clock

thllgo: why not make your own radio clock and hook it up to one of your servers?
 
Old 01-24-2011, 09:07 AM   #7
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
I like that idea, I'm guessing there are instructions someplace on the web?
 
Old 01-24-2011, 10:36 AM   #8
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thllgo View Post
I like that idea, I'm guessing there are instructions someplace on the web?
Yep...and another possibility is to use a cheap GPS receiver. I grabbed a $69 USB GPS receiver, plugged it in, and configured NTP to use the generic NEMA data. Works like a charm, and I have a very reliable stratum-1 time server at home. Use the same thing at work too, but with 5 GPS units in a 'pool', but all running Linux NTP.

I documented it on here before, give a quick search. I think there's even a link to the NTP documentation that tells you how to configure the server line for the different hardware devices.
 
1 members found this post helpful.
Old 01-24-2011, 12:16 PM   #9
thllgo
Member
 
Registered: Sep 2003
Location: Laurel MD
Posts: 296

Original Poster
Rep: Reputation: 32
I'm definitely going to try the GPS idea. My company won't give up the cash to buy one of the professional ones, though I'm sure I can get enough money to buy two or 3 simple GPS units.

Thanks a bunch.
 
Old 01-24-2011, 12:22 PM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,634

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by thllgo View Post
I'm definitely going to try the GPS idea. My company won't give up the cash to buy one of the professional ones, though I'm sure I can get enough money to buy two or 3 simple GPS units.

Thanks a bunch.
No problems, glad to have helped (if I did. ). The thread I did on this is here:
http://www.linuxquestions.org/questi...th-gps-824129/

Obviously, if you're not using a bluetooth GPS, just replace the bluetooth device ID with the USB one, such as /dev/ttyUSB0. A note though...I've seen some instances where the GPS software expects to find a /dev/gps0. If that's the case (may not be any longer), you can just easily make a symlink.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
NTP strange behavior pixellany Linux - Software 4 06-28-2009 06:26 AM
ntp drift file in /etc/ntp instead of /var/lib/ntp - suggestion for a patch in Slack niels.horn Slackware 16 05-07-2009 07:35 PM
help with NTP stevenhasty Slackware 6 02-16-2005 11:04 AM
NTP cannot work with timeserver, NTP-d can jerryvapps Linux - Networking 0 08-04-2004 02:04 PM
NTP cannot use server, NTP -d can jerryvapps Linux - Newbie 0 07-28-2004 02:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:21 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration