Operations 11 min read

How Alibaba Tackles Leap Seconds: A Deep Dive into Time Synchronization

This article explains the evolution of the second, the definitions of UT, TAI and UTC, why leap seconds are needed, their impact on critical IT systems, and details Alibaba's innovative approach of splitting the extra second into 86,400 parts to maintain seamless global time synchronization.

Alibaba Cloud Developer
Alibaba Cloud Developer
Alibaba Cloud Developer
How Alibaba Tackles Leap Seconds: A Deep Dive into Time Synchronization

Definition of the Second

1956: defined as 1/86,400 of the mean solar day.

1960‑1967: defined as 1/86,400 of Earth's rotation period.

1967: redefined by the cesium‑133 hyperfine transition (9,192,631,770 cycles).

1977: adjusted for gravitational time dilation, using cesium atoms at sea level.

2019: discussions on redefining the second as measurement science advances.

Time Standards

UT (Universal Time) is based on Earth's rotation and varies by a few milliseconds daily. TAI (International Atomic Time) is maintained by the BIPM using ~240 atomic clocks worldwide, with nanosecond‑level accuracy. UTC (Coordinated Universal Time) combines UT and TAI, keeping atomic seconds while staying close to solar time.

Why Leap Seconds Occur

Variations in Earth's rotation caused by tides, crustal movements, ice melt, and earthquakes make the solar day slightly longer or shorter; when the difference exceeds 0.9 seconds, the International Earth Rotation and Reference Systems Service (IERS) inserts or removes a second to keep UTC aligned with UT.

Impact of Leap Seconds

For everyday life the extra second is barely noticeable, but in IT, finance, aerospace and other time‑sensitive domains it can cause outages. Notable incidents include service disruptions at major websites during the 2012 leap second. Older Linux kernels may hang or experience high CPU usage, and applications that assume a monotonic clock can crash or produce incorrect timestamps.

Alibaba’s Leap‑Second Strategy

Alibaba splits the additional second into 86,400 pieces, spreading the adjustment over a 24‑hour window. Compared with the traditional “slew” method, this approach reduces the synchronization rate to 0.011574 ms/s, extends the adjustment window to 86,400 seconds, starts the correction 12 hours before the leap second, and limits the maximum UTC offset to 0.5 seconds.

Synchronization rate: 0.5 ms/s → 0.011574 ms/s

Adjustment window: 2,000 s → 86,400 s (24 h)

Start time: at the leap‑second moment → 12 h before

Maximum offset: 1 s → 0.5 s

Testing and Implementation

Two months before the leap second, Alibaba performed extensive tests on large‑scale clusters, verifying that the gradual offset (measured in milliseconds per minute) remained tiny and smooth. The implementation timeline included:

36 h before: primary time source switches from GPS to an internal rubidium clock and clears leap‑second flags.

18 h before: secondary time source links with primary source.

12 h before: secondary sources begin a coordinated adjustment at 0.011574 ms/s.

Leap‑second moment: offset peaks at 0.5 s.

12 h after: secondary sources stop adjusting, primary source reconnects to GPS, and the offset returns to near zero.

During the aggregation phase, hardware, network latency, and temperature variations can affect individual server clocks, requiring careful monitoring.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Alibabaleap secondNTPtime synchronizationUTCsystem operations
Alibaba Cloud Developer
Written by

Alibaba Cloud Developer

Alibaba's official tech channel, featuring all of its technology innovations.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.