CentOS / RHEL 7 : Chronyd V/s NTP service
The synchronization of time on computers and networks is often vitally important. Without it, the time on individual computers will slowly drift away from each other at varying degrees until potentially each has a significantly different time. In systems that rely on ordered events occurring at specific times or logging of events, this can be a real problem. For instance, transactions generated by a computer with a system time slower than another computer may log a transaction as being received before the other computer even though it was generated after it.
Chosing between Chrony and NTP
In RHEL 7 ntpd is replaced by chronyd as the default network time protocol daemon. Chronyd is more accurate and smart time sync mechanism.
Basic configuration for synchronize time and date is stored in the file:
/etc/chrony.conf
ntpd is still included in yum repository for customers who need to run an NTP service.
Chrony is a different implementation of the network time protocol (NTP) than the network time protocol daemon (ntpd) that is able to synchronize the system clock faster and with better accuracy than ntpd.
Benefits of Chrony include:
1. Faster synchronization requiring only minutes instead of hours to minimize the time and frequency error, which is useful on desktops or systems not running 24 hours a day.
2. Better response to rapid changes in the clock frequency, which is useful for virtual machines that have unstable clocks or for power-saving technologies that don’t keep the clock frequency constant.
3. After the initial synchronization, it never steps the clock so as not to affect applications needing system time to be monotonic.
4. Better stability when dealing with temporary asymmetric delays, for example when the link is saturated by a large download.
5. Periodic polling of servers is not required, so systems with intermittent network connections can still quickly synchronize clocks.
When to use chrony
Chrony would be considered a best match for the systems which are frequently suspended or otherwise intermittently disconnected from a network (mobile and virtual servers etc).
When to use NTP
The NTP daemon (ntpd) should be considered for systems which are normally kept permanently on. Systems which are required to use broadcast or multicast IP, or to perform authentication of packets with the Autokey protocol, should consider using ntpd.
for current cloud and container based environment where applications are stateless chronyd play an important role to sync the time on each system.
