Skip to content

Timezone and NTP on Linux — systemd-timesyncd vs chrony

Every host needs a correct clock. The choice between systemd-timesyncd (simple SNTP) and chrony (full NTP) is not arbitrary — here is when each is right.

Every host needs a correct clock. TLS handshakes fail when the clock is off by more than a few minutes, log timestamps become useless for incident review, scheduled jobs fire at the wrong time, and Kerberos authentication breaks entirely. Modern Linux gives you two main options: systemd-timesyncd (simple SNTP client, bundled) and chrony (full NTP implementation). This article walks the comparison and the configuration we use for each role.

How to verify

Check the current state.

timedatectl status
timedatectl show-timesync --all 2>/dev/null | head -10
systemctl is-active systemd-timesyncd chrony chronyd 2>/dev/null
chronyc tracking 2>/dev/null
chronyc sources -v 2>/dev/null

timedatectl status should show System clock synchronized: yes. If it says no or the value is missing, the host is drifting and the next handful of cron jobs will run at wrong-ish times.

What’s happening

The clock on a Linux host is two things stacked: a kernel system time (what clock_gettime returns), and a hardware “real time clock” (RTC) on the motherboard or virtualized RTC on a VM. The kernel time advances by counting timer interrupts; it does not by itself stay aligned with reality. NTP (or its lighter cousin SNTP) is the mechanism that periodically corrects the kernel time against a set of trusted servers.

systemd-timesyncd is a small SNTP client. It queries one server at a time, applies a step correction, and is good enough for most workloads. It does not serve time to others, does not handle the more advanced NTP features (smearing, broadcast), and does not maintain sophisticated drift statistics.

chrony is a full NTP implementation. It queries multiple servers concurrently, picks the best, applies smooth (slewing) corrections rather than jumps, and can serve time to local clients. It is the right choice when: the host is the time source for others, the host is on a slow or jittery network where slewing matters, the host has a Kerberos workload that is allergic to clock jumps, or you simply want detailed diagnostics. On most cloud VMs with a stable provider-supplied NTP, systemd-timesyncd is fine. On bare metal, on hosts with strict timing needs, or as a fleet standard for consistency, chrony is the default we reach for.

Decision

Use systemd-timesyncd when:

  • Small cloud VM, no special timing requirements.
  • Default Ubuntu/Debian host, you want the bundled solution.
  • The provider already runs a high-quality NTP service (AWS Time Sync, Google compute engine, Azure host).

Use chrony when:

  • Bare metal or self-hosted infrastructure.
  • The host needs to serve time to other hosts.
  • A workload (Kerberos, etcd, certain financial systems) cannot tolerate step corrections.
  • You want detailed diagnostics (chronyc tracking, chronyc sources -v).
  • Fleet consistency — your runbook chose chrony, so every host runs it.

In practice, our fleet standard is chrony: one tool to learn, identical diagnostics, identical config across distros. The few extra MB of RAM are irrelevant on a modern host.

The procedure

  1. Set the timezone first. Independent of NTP, but everyone gets this wrong.

    timedatectl list-timezones | grep -i toronto
    sudo timedatectl set-timezone America/Toronto
    timedatectl status

    For fleets that span timezones, the convention is to set every host to UTC and let applications convert for display:

    sudo timedatectl set-timezone UTC
  2. Pick one time daemon and disable the other. On a fresh install you usually have one active; check explicitly.

    systemctl is-active systemd-timesyncd chrony chronyd 2>/dev/null

    Only one should be active. If both are active, the conflict produces unstable corrections.

  3. For systemd-timesyncd, configure the NTP servers in a drop-in.

    sudo mkdir -p /etc/systemd/timesyncd.conf.d
    sudo tee /etc/systemd/timesyncd.conf.d/10-ntp.conf > /dev/null <<'EOF'
    [Time]
    NTP=time.cloudflare.com time.google.com
    FallbackNTP=0.pool.ntp.org 1.pool.ntp.org
    RootDistanceMaxSec=5
    PollIntervalMinSec=32
    PollIntervalMaxSec=2048
    EOF
    sudo systemctl restart systemd-timesyncd
    timedatectl show-timesync --all

    RootDistanceMaxSec=5 rejects servers more than 5 seconds away from the root NTP authority — a sanity check.

  4. For chrony, edit /etc/chrony/chrony.conf. Replace the default pool lines with your preferred sources.

    sudo cp /etc/chrony/chrony.conf /etc/chrony/chrony.conf.bak
    sudo tee /etc/chrony/chrony.conf > /dev/null <<'EOF'
    # Stack Harbor — fleet chrony config
    pool time.cloudflare.com iburst nts
    pool time.google.com iburst
    pool 0.debian.pool.ntp.org iburst
    
    driftfile /var/lib/chrony/drift
    makestep 1.0 3
    rtcsync
    leapsectz right/UTC
    
    # Log slew rate and offsets for diagnostics
    logdir /var/log/chrony
    log measurements statistics tracking
    
    # Only allow time queries from localhost by default
    bindcmdaddress 127.0.0.1
    bindcmdaddress ::1
    EOF
    sudo systemctl restart chrony
    sudo chronyc tracking
    sudo chronyc sources -v

    nts on the Cloudflare pool enables Network Time Security — authenticated NTP. Set the system clock from RTC at boot with rtcsync.

  5. Verify synchronization.

    timedatectl status | grep -E 'synchronized|service'
    chronyc tracking | grep -E 'Stratum|Leap'

    synchronized: yes, Stratum: 2 or 3, Leap status: Normal is the green state. Stratum 0 or Leap status: Not synchronized means the daemon has not yet locked onto a source.

  6. For a host that serves time to others (NTP server role), add allow.

    # Append to /etc/chrony/chrony.conf
    echo 'allow 10.0.0.0/8' | sudo tee -a /etc/chrony/chrony.conf
    sudo systemctl restart chrony
    sudo ufw allow from 10.0.0.0/8 to any port 123 proto udp comment 'NTP'

    The host will now respond to NTP queries from the listed network.

  7. Monitor drift. A host whose clock drifts more than a few hundred microseconds is signalling a hardware or virtualization issue.

    sudo chronyc tracking | awk -F': *' '/Last offset|RMS offset|System time/ {print}'

    Track RMS offset over time — sustained values above 1 ms warrant investigation.

Common pitfalls

  • Both systemd-timesyncd and chrony active simultaneously — they fight, the clock jitters.
  • Setting the timezone but forgetting --adjust-system-clock on RTC-only systems where the RTC was in localtime; the system clock can jump by hours after reboot.
  • Using pool.ntp.org exclusively on a host inside a VPC with no public outbound — fails silently, host slowly drifts.
  • Containerized workloads relying on the container’s notion of time, which is the host’s; running chrony inside the container is pointless and may conflict.
  • Forgetting that timedatectl set-time requires NTP to be off, and that AWS / Azure may override your config with cloud-init.

In our fleets, chrony is the standard, sources are pinned to NTS-authenticated pools, and every host’s offset is monitored. The 03:00 ticket for “TLS handshakes failing intermittently” usually traces to clock skew on a single host, and the standardized configuration is what makes that traceable. This time-correctness layer is part of the Managed Operations baseline.