Cryptographic authentication protocols (Kerberos, TLS certificates), distributed databases (CockroachDB, Cassandra), and financial audit logs strictly require microsecond-accurate system clock synchronization. While standard Ubuntu installations include systemd-timesyncd for basic SNTP time updates, it lacks support for multiple upstream peer voting, aggressive clock slew rate adjustment, and hardware timestamping. Chrony is the modern enterprise standard daemon designed to synchronize system clocks rapidly and maintain extreme accuracy across variable network conditions.
Chrony Architecture vs systemd-timesyncd and Classic ntpd
Chrony consists of two primary binaries: chronyd (the background daemon running in userspace) and chronyc (the command-line diagnostic control interface). Key engineering advantages include:
- Rapid Convergence: Chrony calculates system clock drift rates and applies slewing adjustments immediately, synchronizing clocks within minutes of system boot compared to hours required by legacy ntpd.
- Intermittent Connectivity Resilience: Designed to maintain clock stability even on mobile workstations or virtual machines with high packet jitter.
- Hardware Timestamping: Direct integration with Network Interface Card (NIC) PTP hardware clocks for sub-microsecond synchronization.
Installing Chrony and Disabling Conflicting Daemons
To prevent port conflicts across UDP port 123, install Chrony and deactivate the default systemd stub:
sudo apt update
sudo apt install chrony -y
# Disable systemd-timesyncd
sudo timedatectl set-ntp false
# Enable and start chronyd
sudo systemctl enable --now chrony.service
# Verify chrony is recognized by systemd
timedatectl status
Configuring Upstream NTP Pools and Slew Rates in /etc/chrony/chrony.conf
Open the primary configuration file to define trusted upstream stratum-1 and stratum-2 servers:
sudo nano /etc/chrony/chrony.conf
Configure dedicated NTP pools alongside aggressive initialization burst parameters:
# Designate upstream NTP pools with iburst for rapid initial synchronization
server time.cloudflare.com iburst minpoll 4 maxpoll 8
server time.google.com iburst minpoll 4 maxpoll 8
server pool.ntp.org iburst minpoll 4 maxpoll 8
# Store drift rate in a persistent file across reboots
driftfile /var/lib/chrony/chrony.drift
# Allow the system clock to be stepped in the first three updates if drift > 1 second
makestep 1.0 3
# Smoothly step or slew the clock to prevent jumping backwards in production
maxupdateskew 100.0
# Enable RTC (real-time hardware clock) synchronization
rtcsync
# Log measurements and tracking stats
logdir /var/log/chrony
Save changes and restart the daemon to apply parameters:
sudo systemctl restart chrony
Auditing Synchronization Accuracy and Upstream Peers with chronyc
Use chronyc to monitor server offsets, jitter, and stratum metrics in real time:
# Inspect active upstream sources
chronyc sources -v
# Inspect source statistics and jitter
chronyc sourcestats -v
# View active system clock tracking details
chronyc tracking
In the tracking report, look for:
- Reference ID: The active upstream server selected by the voting algorithm.
- System time: The measured offset against true UTC (typically less than 0.000050 seconds on broadband connections).
- Leap status: Normal (indicating complete leap second compliance).
Deploying Chrony ensures rock-solid temporal consistency across mission-critical Ubuntu clusters and cloud infrastructure.