* cmdallow directive:: Give control access to chronyc on other computers
* cmddeny directive:: Deny control access to chronyc on other computers
* commandkey directive:: Set runtime command key
+* corrtimeratio directive:: Set correction time ratio
* cmdport directive:: Set port to use for runtime commanding
* deny directive:: Deny access to NTP clients
* driftfile directive:: Specify location of file containing drift data
This would make @code{chronyd} use 257/udp as its command port.
(@code{chronyc} would need to be run with the @code{-p 257} switch to
inter-operate correctly).
+@c }}}
+@c {{{ corrtimeratio
+@node corrtimeratio directive
+@subsection corrtimeratio
+When @code{chronyd} makes a time correction, it controls how quickly
+the system clock is slewed (so far only on Linux). This rate
+temporarily affects the frequency error of the system clock.
+
+The @code{corrtimeratio} directive controls the ratio between the
+duration in which the clock is slewed for an average correction
+according to the source history and the interval in which the
+corrections are done (usually the NTP polling interval). Corrections
+larger than the average take less time and smaller corrections take
+more time, the amount of the correction and the correction time are
+inversely proportional.
+
+Increasing @code{corrtimeratio} makes the overall frequency error of
+the system clock smaller, but increases the overall time error as
+the corrections will take longer.
+
+By default, the ratio is 1, which means the duration of an average
+correction will be close to the update interval.
+
+The syntax is
+
+@example
+corrtimeratio 10
+@end example
+
@c }}}
@c {{{ deny
@node deny directive
static void parse_logdir(const char *);
static void parse_maxupdateskew(const char *);
static void parse_maxclockerror(const char *);
+static void parse_corrtimeratio(const char *);
static void parse_reselectdist(const char *);
static void parse_stratumweight(const char *);
static void parse_peer(const char *);
static char *rtc_file = NULL;
static unsigned long command_key_id;
static double max_update_skew = 1000.0;
+static double correction_time_ratio = 1.0;
static double max_clock_error = 1.0; /* in ppm */
static double reselect_distance = 1e-4;
{"dumpdir", 7, parse_dumpdir},
{"maxupdateskew", 13, parse_maxupdateskew},
{"maxclockerror", 13, parse_maxclockerror},
+ {"corrtimeratio", 13, parse_corrtimeratio},
{"commandkey", 10, parse_commandkey},
{"initstepslew", 12, parse_initstepslew},
{"local", 5, parse_local},
/* ================================================== */
+static void
+parse_corrtimeratio(const char *line)
+{
+ if (sscanf(line, "%lf", &correction_time_ratio) != 1) {
+ LOG(LOGS_WARN, LOGF_Configure, "Could not read correction time ratio at line %d", line_number);
+ }
+}
+
+/* ================================================== */
+
static void
parse_reselectdist(const char *line)
{
/* ================================================== */
+double
+CNF_GetCorrectionTimeRatio(void)
+{
+ return correction_time_ratio;
+}
+
+/* ================================================== */
+
double
CNF_GetReselectDistance(void)
{
/* Value returned in ppm, as read from file */
extern double CNF_GetMaxUpdateSkew(void);
extern double CNF_GetMaxClockError(void);
+extern double CNF_GetCorrectionTimeRatio(void);
extern double CNF_GetReselectDistance(void);
extern double CNF_GetStratumWeight(void);
static double max_update_skew;
+static double correction_time_ratio;
+
/* Flag indicating that we are initialised */
static int initialised = 0;
max_update_skew = fabs(CNF_GetMaxUpdateSkew()) * 1.0e-6;
+ correction_time_ratio = CNF_GetCorrectionTimeRatio();
+
enable_local_stratum = CNF_AllowLocalReference(&local_stratum);
CNF_GetMakeStep(&make_step_limit, &make_step_threshold);
Define correction rate as the area of the region bounded by the graph of
offset corrected in time. Set the rate so that the time needed to correct
an offset equal to the current sourcestats stddev will be equal to the
- update interval (assuming linear adjustment). The offset and the
- time needed to make the correction are inversely proportional.
+ update interval multiplied by the correction time ratio (assuming linear
+ adjustment). The offset and the time needed to make the correction are
+ inversely proportional.
This is only a suggestion and it's up to the system driver how the
adjustment will be executed. */
- correction_rate = 0.5 * offset_sd * update_interval;
+ correction_rate = correction_time_ratio * 0.5 * offset_sd * update_interval;
/* Eliminate updates that are based on totally unreliable frequency
information */