Google Software

Leap Smear

On how Google deals with leap seconds:

The solution we came up with came to be known as the “leap smear.” We modified our internal NTP servers to gradually add a couple of milliseconds to every update, varying over a time window before the moment when the leap second actually happens. This meant that when it became time to add an extra second at midnight, our clocks had already taken this into account, by skewing the time over the course of the day. All of our servers were then able to continue as normal with the new year, blissfully unaware that a leap second had just occurred.

Good idea. The second itself is meaningless. Spreading it out is much better/easier than accommodating for it in the rest of your stack.

2 replies on “Leap Smear”

A gradual smear is not required for most companies. Simply shutting off external NTP sometime before midnight and then advancing the internal NTP server by a second will suffice.

The advance won’t cause any issues with time-based keys and such, and after the leap second comes around, the systems will again match world time.

Leave a Reply

Your email address will not be published. Required fields are marked *