NZGames.com Forums
Register FAQ Calendar Mark Forums Read

Go Back   NZGames.com Forums > General > Technology & Troubleshooting
User Name
Password

Reply
 
Thread Tools
Old 9th June 2008, 16:58     #1
Ard Righ
 
Setting ntp sync timing?

Is there anyway to manually specify for ntpd how often to update the time from an internal time server, say once every 30 seconds or so?

We have some servers here doing work between an app server and a database and the app relies on the two having time very closely synced (within a few seconds).

They are both VMs running in ESX 3.5, and I've looked at using VMware tools to sync to local time, but I've been advised that isn't reliable.

If ntpd cannot sync more than once a minute, I assume we'd need a script?
  Reply With Quote
Old 9th June 2008, 20:00     #2
Tarquin
 
You can't set a precise "sync every X seconds" value (usually), but you can set minimum and maximum values; you want the "minpoll" and "maxpoll" options in ntp.conf. (You can use them either by themselves, or as arguments to a peer/server directive.)

The poll intervals are are in seconds, but if you set the config value to x, that makes the poll interval 2^x seconds. The defaults are minpoll=6 (2^6 = 64 sec) and maxpoll=10 (2^10 = 1024 sec = ~17 mins); you can set them as low as 4 (16 sec), or as high as 17 (~36 hours).

ntpd will adjust its internal poll value (within those limits) based on how well it thinks it's tracking the server or peer in question; in your case, you'd want to drop minpoll right down to 4, and maxpoll to 5 or 6.

You probably don't actually need it that low, mind you, unless your use of VMs is screwing up the system clocks somehow: in NTP terms, "within a few seconds" isn't very close at all. (A quick check on one of our Internet-facing servers shows that, using default poll settings, it's only 0.03 seconds out from one of the nz.pool.ntp.org servers, and less than 0.01 out from any of the others.) But if you're just syncing a few internal machines, it's not likely to hurt.

Last edited by Tarquin : 9th June 2008 at 20:02.
  Reply With Quote
Old 10th June 2008, 14:22     #3
Ard Righ
 
Thanks for the info

I did a bit of reading, and I understand that ntp servers are best kept in odd numbers - ie 1 server or a pool of 3.

Currently ntp is setup to check 2 internal ntp servers... whether this causes any issues I don't know, will need more investigation on that. I will see if I can sync them to external servers and see if the time keeping is better.

The minpoll and maxpoll might be all I need to start with. The other issue is working out why ntpd decides to randomly die.
  Reply With Quote
Old 10th June 2008, 18:38     #4
Tarquin
 
I think the odd-numbers thing is mostly just to make it easier to resolve conflicts (ie, with two servers, you don't know which is right; with three, you can usually get two to agree on the most likely answer). It's not usually a problem if you're running with a proper reference clock somewhere in the chain (even if it's just one server talking to an external public NTP server, and the rest of your internal boxes getting time from that one).

If you're looking at an enclosed system where the servers involved have to agree with each other, but don't necessarily have to match the real world too closely, then you want to be using peer rather than server relationships. As an example, we had a system with two core transaction servers and several clients: the two core servers had each other in "peer" directives, and each client had both core servers in "server" directives. (If we'd wanted extra robustness, each client could also have had the other clients in "peer" directives, but it wasn't that important.)

I can't help you with ntpd randomly dying, though; I've never had that happen. What OS are you running it on?

Last edited by Tarquin : 10th June 2008 at 18:39.
  Reply With Quote
Old 10th June 2008, 19:18     #5
Ard Righ
 
We're running VMs - currently RHEL4u4 on ESX 3.5 server. No real patches to any of the 4u4 install except 100MHz kernel timer patch.

The way it is configured at the moment, all the VMs connect over the network to the ntp servers. There are about 40 VMs in total, but for sake of what I am doing, I am only concerned about 2 of those 40 VMs.

I am going to work on the polling and a cron job to monitor ntpd to start, and from there if need be I can look at changing where they sync time from
  Reply With Quote
Reply


Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump



© Copyright NZGames.com 1996-2024
Site paid for by members (love you guys)