Advertisment

Leap Second: How Google saved its websites

author-image
CIOL Bureau
New Update

BANGALORE, INDIA: The Leap Second almost brought the Web down on Sunday morning after the world's timekeepers added an extra second to the day.

Advertisment

The sites that came crashing down included Reddit, FourSquare, Yelp, LinkedIn, Gawker and StumbleUpon after the extra second hit their servers.

Leap Second is an extra second added to Coordinated Universal Time (UTC) - the benchmark time agreed internationally - every few years to keep it in line with the time as determined by the Earth's rotation around the sun.

But, Google was totally safe because of the lessons it has learnt from the past. In a blog post, Google says many computers use a service called the “Network Time Protocol” (NTP), which periodically checks the computers’ time against a more accurate server, which may be connected to an external source of time, such as an atomic clock.

Advertisment

At times, natural calamities create fluctuations in Earth’s rotational speed that affects accurate clocks, like the atomic clocks used by global timekeeping services, which occasionally have to be readjusted to bring them in line with “solar time.” There have been 24 such adjustments or “leap seconds,” since they were introduced in 1972.

According to Christopher Pascoe, Google's reliability engineer, "We saw some of our clustered systems stop accepting work on a small scale during the leap second in 2005, and while it didn’t affect the site or any of our data, we wanted to fix such issues once and for all."

So, the Google came up with its own solution, so it was safe during the leap second in 2008. "We came up with a solution called 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."

Advertisment

"This meant that when time came 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," writes Pascoe in a blogpost.

tech-news