Operating System - HP-UX
1756749 Members
3294 Online
108852 Solutions
New Discussion юеВ

Re: NTP - Atomic Clock - Time Going Backwards ?

 
SOLVED
Go to solution
Laurie_2
Advisor

NTP - Atomic Clock - Time Going Backwards ?

Hi Techies,

I need help answering a question.

Why is it better to use the NTP - Atomic
Clock to adjust time backwards, than just
using the manual adjust?

Folks seem to think:

date mmddhhmm
Is a great way to adjust the time backwards.

I tried to explain it but needed some fancy
technical explaination.

Thank you,
Laurie
How can you make the world a better place
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor

Re: NTP - Atomic Clock - Time Going Backwards ?

Because NTP (al least when you use slewing - and you should) does not adjust time backwards. It does slow your clock ticks down until actual time 'catches up' and then the clocks run normally. In almost every case, it is a bad thing to adjust time backwards. This is especially true in database applications. If you step adjust time backwards it is possible that transaction 1000 could have an earlier timestamp than transaction 999. How would you explain that to a client?


If it ain't broke, I can fix that.
Laurie_2
Advisor

Re: NTP - Atomic Clock - Time Going Backwards ?

OK

How is that different than the date -a:

Using the -a option on the date command allows adjustment of the time over a
period of time. That means it does not have to be set back. With a negative
adjustment, it just goes forward at a slower rate.

I'm trying to prove that the NTP and Atomic
clock is better than the date -a.

Laurie
How can you make the world a better place
James R. Ferguson
Acclaimed Contributor

Re: NTP - Atomic Clock - Time Going Backwards ?

Hi Laurie:

The simple answer to your last query is that 'ntp' allows you to *maintain* time if/when your's server's clock drifts. It is a very low-overhead, "permanent" solution to your time-keeping problems when properly setup and when using at least two independent time sources. Remember, too that 'ntp' will cease to use time packets that are too far from your server's time. This prevents "time insanity".

Regards!

...JRF...
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: NTP - Atomic Clock - Time Going Backwards ?

That's a different question that your original. Your original question involved a 'step' time adjustment - almost always bad especially backwards but your second question concerns the use of date -a to slew adjust the time. This is a perfectly acceptable way to adjust the time; it makes use of the adjtime() system call. Man adjtime for details and a good explanation. The downside of using date -a is that: 1) you have to determine how far off you are from reference time; 2) you then have to make date -a calls; and 3) you have to continually repeat steps 1 and 2. If instead you use NTP, this is done continuously and automatically and can easily keep all the clients synchrozied to within a few tens of ms of 'real time' even with just an Internet time source.
If it ain't broke, I can fix that.
Wodisch
Honored Contributor

Re: NTP - Atomic Clock - Time Going Backwards ?

Hi Laurie,

and a lot of other problems might happen:
- your backup might be started again (but before the current one is done, thus deytroying your backup)
- logfiles might be "rotated" again (but on the same day, and hence delete the slightly earlier version, so you would have a *gap* in your logfiles)
- everything about time might go wrong: at, crontab, every kind of synchronization...

VERY bad idea :-(

HTHFY (hope to have frightened you),
Wodisch
John Payne_2
Honored Contributor

Re: NTP - Atomic Clock - Time Going Backwards ?

NTP is a 'set it and forget it' solution to a problem. If you get NTP configured correctly, you never have to worry about whether or not the time you see is the time you have got.

In an environment with more than one machine and backups, you always want to know the time is correct. Without a correct time, you are setting yourself up for problems later.

Hope it helps

John
Spoon!!!!
Laurie_2
Advisor

Re: NTP - Atomic Clock - Time Going Backwards ?

My question is what is 'slewing' ?? How can I tell if we are using slewing??
or how to change to use???

Laurie

p-s: I am using these answers for the
jenzabar list server - used by Colleges
basically I'm a communication nut (love email). Tho I stay away from the informix list server if possible since it's more technical than I need to know.
How can you make the world a better place
A. Clay Stephenson
Acclaimed Contributor

Re: NTP - Atomic Clock - Time Going Backwards ?

'Slewing' is simply the concept of speeding up or slowing down the client's 'clock ticks' until it is in sync with the reference time. In contrast, 'stepping' is an abrupt one-time adjustment. In almost all cases, NTP doews slewing. The exception to this is using the NTP command 'ntpdate' to force a step adjustment. Ntpdate should be used with the -B option to force slewing in all cases. Man ntpdate for these details.

Since you mentioned Informix (and thus databases), I assure you that all you ever want to do is 'slewing' to avoid the bogus timestamp problems. If you will simply set up NTP (your stratum 1 server should be your Atomic Clock), it will always slew UNLESS you use the ntpdate command. Ntpdate is only used to make one-time adjustments and then NTP takes over from there.
If it ain't broke, I can fix that.