From Fedora Project Wiki
No edit summary
No edit summary
Line 22: Line 22:
* much faster synchronization, it usually needs only minutes instead of hours to minimize the time and frequency error
* much faster synchronization, it usually needs only minutes instead of hours to minimize the time and frequency error
* larger range for frequency correction (100000 ppm vs 500 ppm), this is useful for systems running in virtual machines which may have unstable and quickly drifting clocks
* larger range for frequency correction (100000 ppm vs 500 ppm), this is useful for systems running in virtual machines which may have unstable and quickly drifting clocks
* after the initial synchronization the clock is never stepped, this is good for applications which need system time to be monotonous
* after the initial synchronization the clock is never stepped, this is good for applications which need system time to be monotonic
* better response to rapid changes in the clock frequency
* better response to rapid changes in the clock frequency
* better stability with temporary asymmetric delays, e.g. when the link is saturated by a large download
* better stability with temporary asymmetric delays, e.g. when the link is saturated by a large download
Line 33: Line 33:


There are also some disadvantages:
There are also some disadvantages:
* ntp may still performs better in the conditions which it was optimized for, i.e. systems with high quality oscillators and noisy networks, but the difference is quite small (see the [http://mlichvar.fedorapeople.org/clknetsim/chrony_ntp simulations])
* ntp may still perform better in some conditions, but the differences are quite small (see the [http://mlichvar.fedorapeople.org/clknetsim/chrony_ntp simulations])
* advanced NTP features like Autokey authentication are not supported
* advanced NTP features like Autokey authentication are not supported



Revision as of 16:31, 11 July 2011

Chrony default NTP client

Summary

Make chrony the default NTP client.

Owner

  • Email: mlichvar@redhat.com

Current status

  • Targeted release: Fedora 16
  • Last updated: 2011-07-11
  • Percentage of completion: 0%

Detailed Description

Chrony is an NTP client and server designed to work well without permanent network connection. It uses different algorithms to discipline the clock which gives chrony several advantages over ntp:

  • periodic polling of servers is not required which allows it to work well even with large periods of time without network connection
  • much faster synchronization, it usually needs only minutes instead of hours to minimize the time and frequency error
  • larger range for frequency correction (100000 ppm vs 500 ppm), this is useful for systems running in virtual machines which may have unstable and quickly drifting clocks
  • after the initial synchronization the clock is never stepped, this is good for applications which need system time to be monotonic
  • better response to rapid changes in the clock frequency
  • better stability with temporary asymmetric delays, e.g. when the link is saturated by a large download

An extensive comparison of ntp and chrony done in a simulator is here. Note that current Linux kernels are compiled with SHIFT_PLL=2.

Using chrony over ntp has also other advantages:

  • smaller memory footprint (1.3MB vs 6MB resident size)
  • no unnecessary process wakeups, this is good for powersaving. The ntpd process normally wakes up every second. We apply a patch which reduces the number of wakeups significantly, but upstream is not interested in fixing it (ntp bug #802).

There are also some disadvantages:

  • ntp may still perform better in some conditions, but the differences are quite small (see the simulations)
  • advanced NTP features like Autokey authentication are not supported

Benefit to Fedora

Better timekeeping on systems not running 24/7 or without permanent internet connection or with low quality/unstable clocks (virtual machines). Once the clock is synchronized, applications are not upset by backward time jumps.

Scope

  • system-config-date needs to be patched to support both packages and remove the dependency on ntp. The supported options supported by system-config-date are identical in ntp.conf and chrony.conf, so it's just a matter of finding out which one is installed/enabled and select the correct path and service name. A patch is available (bug #616385).
  • comps needs to be modified to install chrony by default and mark ntp as an optional package

How To Test

  • make fresh installation, or install chrony and uninstall ntp
  • start NTP in system-config-date and let it run for few minutes
  • check "chronyc tracking" output. The Reference ID field should be a valid NTP server (not 0.0.0.0), System time should be close to zero (less than few milliseconds).
  • make sure it works also after reboot, suspend and reconnecting to a network.

Dependencies

 system-config-date
 comps

Contingency Plan

Switching the optional/default types for the ntp and chrony packages in the comps will revert to installing ntp by default. system-config-date can still support both packages and doesn't need to depend on any of the two packages.

Documentation

Release Notes

  • Fedora now installs chrony as the default NTP client. The ntp package is still supported. The users are encouraged to install ntp and uninstall chrony if it suits their needs better.

Comments and Discussion