Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ntpd loses connection to pool.ntp.org
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
ben_dash
Apprentice
Apprentice


Joined: 12 Aug 2003
Posts: 239

PostPosted: Fri Aug 04, 2006 3:07 am    Post subject: ntpd loses connection to pool.ntp.org Reply with quote

I have noticed that my Gentoo router's ntpd tends to lose its connectivity to the *.pool.ntp.org stratum 3 servers every few weeks or months.

This isn't a big deal, as I usually notice fairly quickly as my MthTV server is one of its ntp clients and time drift is obvious when watching recordings that start to begin either a couple of seconds too early or a couple of seconds to late.

Here's my "ntpq -c pe" output after stopping ntpd on the router and re-running "ntpdate pool.ntp.org":

Code:
alpha root # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 a.pool.ntp.uq.e 130.102.152.7    2 u  213  256   17  217.831    6.573   1.890
 ntp.cis.rv.ua   129.69.1.153     2 u  210  256   17  175.226   -3.592   3.062
 evenstar.silver 192.36.134.25    2 u  212  256   17  147.978   -4.070   1.074
alpha root # ntpq -c rv |grep stratum
processor="i686", system="Linux/2.6.11-gentoo-r9", leap=11, stratum=16,
alpha root # ntpq -c rv |grep stratum
processor="i686", system="Linux/2.6.11-gentoo-r9", leap=11, stratum=16,
alpha root # ntpq -c rv |grep stratum
processor="i686", system="Linux/2.6.11-gentoo-r9", leap=00, stratum=3,
alpha root # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+a.pool.ntp.uq.e 130.102.152.7    2 u  187  512   37  217.831    6.573   1.845
*ntp.cis.rv.ua   129.69.1.153     2 u  187  512   37  174.946   -4.267   3.245
+evenstar.silver 192.36.134.25    2 u  186  512   37  147.978   -4.070   0.937


I understand that these servers have a certain amount of unreliability, and that's fine, but it seems that after a couple of months I'm 100% guaranteed to loose connectivity to all three servers that *.pool.ntp.org provides me, because their stratum goes up to 16.

Does anyone have any advice on how often I should restart ntpd in order to re-map my *.pool.ntp.org domains to new ntp servers?

Here's my /etc/ntp.conf for reference:

Code:
alpha root # cat /etc/ntp.conf
#restrict default noquery notrust nomodify
restrict default kod nomodify notrap nopeer noquery
restrict 127.0.0.1 nomodify
restrict 192.168.0.1 mask 255.255.255.0 nomodify nopeer notrap
fudge 127.127.1.0 stratum 3
server 0.pool.ntp.org
server 1.pool.ntp.org
server 2.pool.ntp.org
#server 127.127.1.1
driftfile /var/lib/ntp/ntp.drift
logfile /var/log/ntp.log


Also, I'm curious why the polling success seems so varied between my various clients and servers:

Code:
alpha root # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
+a.pool.ntp.uq.e 130.102.152.7    2 u   43   64  377  217.321   31.321   5.463
*ntp.cis.rv.ua   129.69.1.153     2 u   38   64  377  177.224   18.425   9.038
+evenstar.silver 192.36.134.25    2 u   37   64  377  149.076   16.320   8.834
alpha root # ntpq -c rv |grep stratum
processor="i686", system="Linux/2.6.11-gentoo-r9", leap=00, stratum=3,

beta ~ # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 alpha           194.44.92.10     3 u  807 1024    1    1.376  -2462.9   0.001

omega ~ # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 alpha           194.44.92.10     3 u 1002 1024    1    0.349  -19997.   0.001

gamma ~ # ntpq -c pe
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
*alpha           194.44.92.10     3 u    1   64  377    0.277  -12.140   7.409


Why is gamma reaching my ntp server, alpha, so much more than all the other machines? They are all configured exactly the same.

Finally all my clients reached stratum 4 while my router is stratum 3, it seems strange that there was so much difference between the number of ntp requests that "reach"ed and how quickly that number increased. weird.

Thanks for any advice!
_________________
Free Question Answerer
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Fri Aug 04, 2006 9:39 am    Post subject: Reply with quote

Quote:
Does anyone have any advice on how often I should restart ntpd in order to re-map my *.pool.ntp.org domains to new ntp servers?
Daily should be a good first step, to be halved if you still have problems.

Although pool.ntp.org is the best idea for spreading the load and getting working servers, you could also consider putting in a fixed list of, say, 10 or 15 servers from the public server list at http://ntp.isc.org/bin/view/Servers/WebHome

Quote:
I'm curious why the polling success seems so varied between my various clients and servers
I'm not sure if I've understood you but beta and omega have set the polling period up to the maximum, 1024, while gamma is still at the first stage, 64. As far as I know, this is to do with the ease with which beta and omega have in getting to alpha over the network and the difficulty that gamma has had.

Quote:
number of ntp requests that "reach"ed and how quickly that number increased
Again, I'm not sure whether I've understood you correctly but the reach number is eight bits with the low order bit being set to 1 when a poll succeeds in reaching the server or set to 0 if it fails.
_________________
The avatar is jorma, a "duck" from "Elephants Dream": the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details.
Back to top
View user's profile Send private message
ben_dash
Apprentice
Apprentice


Joined: 12 Aug 2003
Posts: 239

PostPosted: Fri Aug 04, 2006 12:24 pm    Post subject: Reply with quote

Hmmm, all the machines are on the same LAN with a gigabit switch. I wonder why any of them would have any difference in their abilities to talk to alpha.

It looks like I totally misunderstood what "poll" and "reach" meant... time for a little NTP research for me :-)

It seems like the issue of the pool.ntp.org servers gradually losing stratum status would be a common one. If the solution is to cycle the ntpd daemon twice a day do you already have a script to do this, I don't want to reinvent the wheel...

Thanks!!!
_________________
Free Question Answerer
Back to top
View user's profile Send private message
wynn
Advocate
Advocate


Joined: 01 Apr 2005
Posts: 2421
Location: UK

PostPosted: Fri Aug 04, 2006 1:02 pm    Post subject: Reply with quote

Quote:
If the solution is to cycle the ntpd daemon twice a day do you already have a script to do this
Funny, I was going to answer this question in my first post until I reread the question you had actually asked :)

Couldn't you put
Code:
/etc/init.d/ntpd restart
in crontab. I'd look up how to do it but I'm sure you know better than me.
_________________
The avatar is jorma, a "duck" from "Elephants Dream": the film and all the production materials have been made available under a Creative Commons Attribution 2.5 License, see orange.blender.org for details.
Back to top
View user's profile Send private message
tgh
Apprentice
Apprentice


Joined: 05 Oct 2005
Posts: 222

PostPosted: Mon Aug 14, 2006 6:22 am    Post subject: Reply with quote

Looks like you're only talking to (3) NTP servers in your config. You might want to up that to (5) NTP servers from the pool. You can have more, but NTP will only talk to a maximum of 10. You may need to add entries from another country code (if you're in the US, use the Canada pool entries such as 0.ca.pool.ntp.org to gain additionals). For instance:

server 0.us.pool.ntp.org
server 1.us.pool.ntp.org
server 2.us.pool.ntp.org
server 0.ca.pool.ntp.org
#server 1.ca.pool.ntp.org
#server 2.ca.pool.ntp.org

I would suggest not restarting ntp more often then once per week. As long as the NTP daemon has been running for a while and has been tracking a few stable time sources, it should be fine for a day or two until the weekly restart. Of course, YMMV.

If you're servicing multiple clients, you may want to look into adding a single Statum Two entry at the top (to make it easy to see) of your server list. That would be in addition to the 4 or 5 servers from the pool. Whether those stratum two servers listed at the ntp.org website will stay around for a while is a bit of guesswork.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum