[ntp:questions] ntpd -q and driftfile

Chris Albertson albertson.chris at gmail.com
Tue Mar 22 17:39:49 UTC 2011


On Mon, Mar 21, 2011 at 11:38 PM, prashant sherin <pvsnmp at yahoo.com> wrote:
> Hi,
> I would like to know if ntpd would use the driftfile specified in /etc/
> ntp.conf file if it is run periodically using crontab with -q option
> as below:

That is a rather resource intensive way to run NTP.   You use fewer
CPU cycles just letting ntpd run in the background.   ntpd will decide
all by itself that it can "sleep" once the clock is running well.
The longer ntp has been running the longer these sleep periods tend to
be.   It actually does more work when it starts up than after running
for a few hours.   Placing it in the cron tab will force NTP to
endlessly go through the hard work of staring up.

You want a really bad car analogy?  To bad you get one anyway....
Cars use most of their gas accelerating up to speed after stopping for
a red light.   They use the least gas when cruising at steady speed of
35MPH.   Same with NTP by far most of the resources are used in the
fist minute or so.  First off Cron has to create a shell process and
that process creates an instances of NTP by loadingit's code from the
disk into RAM, ntp then exchanges messages with other ntp servers at a
relatively fast rate.  but after ntpd has been running for a few hours
it has settled into doing almost nothing


-- 
=====
Chris Albertson
Redondo Beach, California



More information about the questions mailing list