Xentara v2.1
User Manual
Improving Time Synchronization (Linux Only)
See also
RFC 5905 — Network Time Protocol Version 4: Protocol and Algorithms Specification

Many Linux installations use systemd-timesyncd(8) for time synchronization by default. systemd-timesyncd is designed to be used for normal office computers, where strict timing and accurate time synchronization are generally not required. In technical applications, systemd-timesyncd generally does not provide adequate time synchronization.

systemd-timesyncd has the following two shortcomings when used in time-sensitive applications:

  • Clock Discipline

    systemd-timesyncd does not perform any clock discipline. If the hardware clock on your computer is running slow or fast, a fully featured NTP client will adjust the speed of the clock accordingly, so that it will always run at the correct speed. This is especially important because the speed of the hardware clock can vary with temperature, causing it to slow down or speed up as the system gets hotter or colder with outside temperature, or with varying CPU load. systemd-timesyncd does not attempt to correct the clock speed, but instead just sets the time to the correct time at regular intervals. Every time systemd-timesyncd adjusts the time in this fashion, the clock will jumps forward or backward, making it difficult for Xentara to maintain accurate timing. This can result in very uneven timer performance, or even lost timer cycles.

  • Accuracy

    systemd-timesyncd uses SNTP (Simple Network Time Protocol) instead of NTP (Network Time Protocol). SNTP provides less accurate time synchronization than NTP.

If your system uses systemd-timesyncd, it is strongly recommended that you replace it with a fully featured NTP client, as described in this chapter. Alternatively, you can use the highly accurate PTP (Precision Time Protocol) protocol instead of NTP, as described under Time Synchronization Using PTP.

Determining Which Time Synchronization is Used

To determine which time synchronization service is currently in use, run the following command in a terminal:

apt list ~DReplaces:~ntime-daemon

The output will look something like this:

Listing... Done
chrony/stable 4.3-2+deb12u1 arm64
ntpsec/stable,stable-security 1.2.2+dfsg1-1+deb12u1 arm64
openntpd/stable 1:6.2p3-4.2+b1 arm64
systemd-timesyncd/unknown,now 254.16-1~bpo12+1bbbio0~bookworm+20240807 arm64 [installed]

One (and only one) of the lines will end with the text “[installed]”, denoting that this is the service that is currently being used. In this example, systemd-timesyncd is used to synchronize the time. This is the default on many Debian-based Linux distributions.

The following example shows a system where systemd-timesyncd was originally used, but has been replaced with chrony:

Listing... Done
chrony/stable,now 4.3-2+deb12u1 arm64 [installed]
ntpsec/stable,stable-security 1.2.2+dfsg1-1+deb12u1 arm64
openntpd/stable 1:6.2p3-4.2+b1 arm64
systemd-timesyncd/unknown,now 254.16-1~bpo12+1bbbio0~bookworm+20240807 arm64 [residual-config]

Note that systemd-timesyncd is marked with the text “[residual-config]”. This means that systemd-timesyncd was used at some point in the past, but has since been removed. In that case, the configuration files for systemd-timesyncd will still be present on the system, because the apt(8) utility does not delete any configuration files when removing an installed package. This is deliberate, so that the configuration for the package will still be there should you ever want to switch back to the old service.

See also
systemd-timesyncd(8)
chrony
NTPsec
OpenNTPD

Replacing systemd-timesyncd With chrony

See also
chrony

Unless you have specific requirements for one of the other available NTP implementations, you should use chrony for time synchronization. Replacing systemd-timesyncd with chrony can be done using the following simple terminal command:

sudo apt install chrony

This command will remove systemd-timesyncd and install and configure chrony. Time synchronization will start immediately, no reboot is required.

Note
The user executing this command will need special privileges to be able to use sudo(8). This is usually accomplished by adding the user to the sudo user group. This can only be done by the root user, or by another user that already has sudo access.