How to Configure Chrony and PTP on Ubuntu Server for Sub-Millisecond Clock Synchronization

In distributed database clusters (such as CockroachDB, Cassandra, or Apache Kafka), high-frequency financial trading systems, and cryptographic logging platforms, slight clock drift between servers can cause split-brain failures, transaction rollbacks, and distributed deadlock anomalies. While legacy NTP daemons take hours to stabilize clock frequency, Chrony adjusts the system clock rapidly with microsecond precision, and PTP (Precision Time Protocol / IEEE 1588) leverages hardware network interface timestamping to achieve sub-microsecond synchronization across local network topologies.

Installing and Enabling Chrony on Ubuntu Server

Modern Ubuntu Server releases use systemd-timesyncd by default for basic desktop-grade time synchronization. For enterprise server environments requiring high precision and multiple time sources, replace it with Chrony:

sudo apt update
sudo apt install chrony -y

Installing Chrony automatically disables systemd-timesyncd to eliminate port 123 conflicts. Ensure the service is active and set to launch on boot:

sudo systemctl enable --now chrony
sudo systemctl status chrony
Protocol / Daemon Network Layer Hardware Timestamping? Typical Accuracy
systemd-timesyncd SNTP (Simple NTP) No 10 to 50 milliseconds
Chrony (NTP Mode) NTPv4 UDP 123 Optional Tens of microseconds
PTP (linuxptp / ptp4l) IEEE 1588 (Ethernet / UDP) Yes (PHY layer) Sub-microsecond (< 1 µs)

Configuring Low-Latency Upstream NTP Pools

Open the primary Chrony configuration file at /etc/chrony/chrony.conf:

sudo nano /etc/chrony/chrony.conf

Configure stratum-1 reference servers or low-jitter geographical pools using the iburst directive for instant synchronization upon startup:

# Configure geographically close NTP pools with burst polling
server time.cloudflare.com iburst minpoll 4 maxpoll 8
server time.google.com iburst minpoll 4 maxpoll 8
pool pool.ntp.org iburst

# Allow slewing system clock without step jumps in production
makestep 0.1 3

# Save clock drift rate across reboots
driftfile /var/lib/chrony/chrony.drift

# Log tracking telemetry
logdir /var/log/chrony
log measurements statistics tracking

Save changes and restart Chrony:

sudo systemctl restart chrony

Auditing Clock Drift and Tracking Status

Chrony includes the chronyc interactive tool to inspect server synchronization telemetry in real time:

# View active peer time servers and stratum offsets
chronyc sources -v

# Inspect detailed system clock drift, jitter, and root delay
chronyc tracking

Look at the System time and RMS offset rows. An RMS offset under 0.000050 seconds indicates clock drift under 50 microseconds.

Enabling Hardware-Timestamped PTP with linuxptp

For financial or industrial systems connected via low-latency switches supporting IEEE 1588 boundary clocks, install linuxptp:

sudo apt install linuxptp -y

Verify whether your network card (NIC) supports hardware timestamping using ethtool:

ethtool -T eth0

If output lists SOF_TIMESTAMPING_TX_HARDWARE and SOF_TIMESTAMPING_RX_HARDWARE, start ptp4l to slave your interface clock directly to the master PTP grandmaster clock:

sudo ptp4l -i eth0 -m -S

Then synchronize the Linux kernel system clock to the PTP hardware clock using phc2sys:

sudo phc2sys -s eth0 -w -m

This hybrid architecture guarantees nanosecond-level time stamps, ensuring distributed state integrity across mission-critical compute nodes.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.