Operating System - HP-UX
1752657 Members
5485 Online
108788 Solutions
New Discussion юеВ

Re: What is the sync interval time in NTP

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

What is the sync interval time in NTP

Hi All,

I would like to test NTP configuration in my test server.

So I have just now configured NTP client for time synchronization.

After that the time has been synced with NTP server.

Ex:

#date

Tue Mar 9 11:19:00 CST 2010


Then I would like to check the synchronization with NTP server.

So that I have changed the time using the command date.

Ex:

# date 030910382010

Tue Mar 9 10:38:11 CST 2010

I have changed the time to 30 mins later.

Then I have waited for about 3 hrs to see whether the time is syncing with NTP server.

Still it is not synced with NTP server.

Still the time remail 30 mins later than NTP server.

What is the sync interval time in NTP?

When can we see the NTP server time in local serer?
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: What is the sync interval time in NTP

Hi:

> I have changed the time to 30 mins later.
Then I have waited for about 3 hrs to see whether the time is syncing with NTP server.
Still it is not synced with NTP server.

You will never synchronize. NTP abandons its efforts if the difference in time between your server and an NTP source is ~ 1000 seconds (~ 16+ minutes). This prevents insane time corrections.

Read this chapter:

http://docs.hp.com/en/B2355-91060/ch04.html

In particular, see the trouble-shooting section and the 'ntpq' utility.

Regards!

...JRF...

senthil_kumar_1
Super Advisor

Re: What is the sync interval time in NTP

Hi James,

Now the difference is 8 mins between local server and NTP server.

I have changed the time accordingly.

Now also I am waiting for 10 mins still the time is not synchronized with NTP server.

How to solve this.
James R. Ferguson
Acclaimed Contributor

Re: What is the sync interval time in NTP

Hi (again):

In general, about 5-6 poll cycles (at 64-seconds by default) occur before synchronization. You can verify that you have reached (associated) with a time source with 'ntpq -p'. An asterisk ("*") will precede the the IP or node name to which synchronization has occured. A "+" indicates that the source is a candidate.

Regards!

...JRF...

Steven E. Protter
Exalted Contributor
Solution

Re: What is the sync interval time in NTP

Shalom,

ntp does not do instant time correction. It can't.

If your system was running fast and ntp rolled the time back, a database program like Oracle would immediately crash.

I've done it, not pretty.

ntp makes adjustments over time. It runs the clock slightly slower if its running fast and slightly faster if its behind.

If the difference is under an hour, it can take a while for this process to complete.

ntpq is a good utility for seeing what is going on.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
rick jones
Honored Contributor

Re: What is the sync interval time in NTP

And while the NTP client on the system may have synced to an NTP server, it will still, as pointed-out, take quite some time to have the difference in time shrink to small values. NTP is very, well, patient, in this regard. It uses some rather sophisitcated algorithms to get the local clock moving forward in time in sync with the clock to which it has synced.
there is no rest for the wicked yet the virtuous have no pillows
James R. Ferguson
Acclaimed Contributor

Re: What is the sync interval time in NTP

Hi (again):

The default for 'xntpd' (NTP) is to *step* the server time rather than slew it. It is therefore generally advisable to configure 'ntpdate' to run at boot-time; step the clock; and then let 'xntpd' make small, further step or slew adjustments as necessary.

To cause 'ntpdate' to run as startup and thus adjust any large time delta immediately and once, set the following variables in '/etc/rc.config.d/netdaemons':

# export NTPDATE_SERVER=mytimeserver.xyz.com
# export XNTPD=1

To cause 'xntpd' to slew, do:

# export XNTPD_ARGS=-x

See the 'xntpd' manpages for more information.

Regards!

...JRF...
rick jones
Honored Contributor

Re: What is the sync interval time in NTP

It will "step" for differences greater than a threshold. It will slew for differences less than that threshold. And as already mentioned, it will give-up entirely for differences greater than another threshold.
there is no rest for the wicked yet the virtuous have no pillows
senthil_kumar_1
Super Advisor

Re: What is the sync interval time in NTP

Hi All,

I have some questions:

1)Instead of configuring NTP, can I just run ntpdate ntp_server_name in crontab to update the time at 5 mins time interval?


2)What is the disadvantage of doing that?

3)I have configured NTP and ntpdate in startup also. the time is syncing with NTP server. Suddenly one day I have changed the time manually using the command date to be 1 hr later, then if I am restarting the server, the ntpdate will be ran at startup and fetch the time form NTP server, at this situation, will my oracle corrupt?
James R. Ferguson
Acclaimed Contributor

Re: What is the sync interval time in NTP

Hi:

> 1)Instead of configuring NTP, can I just run ntpdate ntp_server_name in crontab to update the time at 5 mins time interval?

Why? The 'xntpd' daemon is just that, a process that runs all the time, making very small corrections. It is spawned once and runs "forever",

> 2)What is the disadvantage of doing that?

Your time control may not be as accurate and you impose the overhead of process creation when you don't need to do so (see #1, above).

> 3)I have configured NTP and ntpdate in startup also. the time is syncing with NTP server. Suddenly one day I have changed the time manually using the command date to be 1 hr later, then if I am restarting the server, the ntpdate will be ran at startup and fetch the time form NTP server, at this situation, will my oracle corrupt?

Changing time forward isn't as harmful as changing it backwards! However, a good policy with databases and other time-sensitive applications is to stop them before a manual time adjustment. In a "good" configuration, at startup, a valid time is established before your database(s) are started.

Regards!

...JRF...