[chrony-dev] frequency fallback when running unsynchronised

[ Thread Index | Date Index | More chrony.tuxfamily.org/chrony-dev Archives ]


I was thinking it would be nice to have a frequency fallback mechanism
when running unsynchronised for long time to avoid quickly drifting
away if there was a short-term deviation in drift just before the
synchronisation was lost. Something better than using longer polling
intervals.

The attached patch implements a series of exponential moving averages
of absolute clock frequencies that are calculated over exponentially
increasing intervals. When chronyd is unsynchronised for some
specified interval, it will start switching the clock frequency to the
long-term averages.

It can be configured with a new directive:

fallbackdrift 10 16

This configures chronyd to maitain 7 averages for intervals from 2^10
to 2^16 seconds.

The default values are quite conservative, the intervals are set to 16
(18 hours) and 19 (6 days). When chronyd is running unsynchronised for
18 hours it will set the clock frequency to the first average computed
over about 15-40 hours before the synchronisation was lost and to the
last after 6 days. I'm hoping this will cover the usual daily and
weekly temperature cycles.

What do you think? Is it useful?

I'd appreciate if it could receive more testing before I push it.
Maybe tweaking of some of the constatns would be good. Suggestions
welcomed.

The frequency changes are reported in tracking.log. For example:

2010-04-09 07:42:04 PPS0             1     97.613      0.004  2.189e-08
2010-04-09 07:42:08 PPS0             1     97.614      0.004  6.226e-08
2010-04-09 07:42:12 PPS0             1     97.614      0.004  5.617e-08
2010-04-09 07:42:16 PPS0             1     97.614      0.004 -7.244e-08
2010-04-09 07:42:56 0.0.0.0          0     97.614      0.004  0.000e+00
2010-04-09 07:43:20 0.0.0.0          0     97.610      0.004  0.000e+00
2010-04-09 07:44:24 0.0.0.0          0     97.609      0.004  0.000e+00
2010-04-09 07:46:32 0.0.0.0          0     97.611      0.004  0.000e+00
2010-04-09 07:50:48 0.0.0.0          0     97.621      0.004  0.000e+00
2010-04-09 07:59:20 0.0.0.0          0     97.647      0.004  0.000e+00
2010-04-09 08:16:24 0.0.0.0          0     97.703      0.004  0.000e+00
2010-04-09 08:50:32 0.0.0.0          0     97.767      0.004  0.000e+00
2010-04-09 09:58:48 0.0.0.0          0     97.801      0.004  0.000e+00

-- 
Miroslav Lichvar






Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/