Slashdot Mirror


Google's New Public NTP Servers Provide Smeared Time (googleblog.com)

Google says it has built support for the leap second into the time servers that regulate all Google services. An anonymous reader shares a blogpost by Google:No commonly used operating system is able to handle a minute with 61 seconds, and trying to special-case the leap second has caused many problems in the past. Instead of adding a single extra second to the end of the day, we'll run the clocks 0.0014% slower across the ten hours before and ten hours after the leap second, and "smear" the extra second across these twenty hours. For timekeeping purposes, December 31 will seem like any other day. All Google services, including all APIs, will be synchronized on smeared time, as described above. You'll also get smeared time for virtual machines on Compute Engine if you follow our recommended settings. You can use non-Google NTP servers if you don't want your instances to use the leap smear, but don't mix smearing and non-smearing time servers.

34 of 179 comments (clear)

  1. Does this mean.... by The-Ixian · · Score: 3, Funny

    Does this mean that my DPS will be slightly higher on December 31st?

    --
    My eyes reflect the stars and a smile lights up my face.
    1. Re:Does this mean.... by Diss+Champ · · Score: 3, Funny

      That depends largly on whether you play better or worse while drunk. The NTP server tweak will be a secondary effect at best.

    2. Re:Does this mean.... by Anonymous Coward · · Score: 5, Funny

      Does this mean that my DPS will be slightly higher on December 31st?

      No. It means you'll lose a second of uptime.

  2. Not new, just a holiday reminder PSA by Anonymous Coward · · Score: 5, Informative

    Google has been smearing leap seconds over NTP since 2011. This is a public reminder that Google NTP will be serving smear seconds because there is one coming.

    1. Re:Not new, just a holiday reminder PSA by lgw · · Score: 2

      Leap seconds: even less desirable than Daylight Saving Time.

      Seriously, why do we put up with this shit. The precise details of the Earth's rotation just aren't that important, except to a few hundred professional telescope operators, who have a history of keeping time their own way anyhow.

      --
      Socialism: a lie told by totalitarians and believed by fools.
  3. Sounds like a part of the Star Trek:DTI Manual by wiredog · · Score: 5, Funny

    "don't mix smearing and non-smearing time servers"

  4. Some examples of smeared time by squiggleslash · · Score: 5, Funny

    At 4.37 it'll report that 4.38 molests goats. 4.38 will retaliate by claiming 4.37 killed a man and lied about it. 4.39 will accuse 4.38 of secretly having two wives who know nothing about one another. 4.40 will claim 4.38 and 4.37 are having a secret affair and are making up allegations about one another to hide the fact. 4.41 will claim 4.40 is a multiple felon. 4.42 will accuse 4.41 of cheating on his taxes...

    --
    You are not alone. This is not normal. None of this is normal.
    1. Re:Some examples of smeared time by Ashtead · · Score: 4, Funny

      And meanwhile 4:20 enjoys a joint off to the side.

      --
      SIGBUS @ NO-07.308
    2. Re:Some examples of smeared time by TheRaven64 · · Score: 2

      Did that read like an extract from Exodus to anyone else?

      --
      I am TheRaven on Soylent News
  5. Re:Falsehoods Developers Believe About Time by heypete · · Score: 4, Informative

    Because that's how they did it before and they consider it "safer" in the context of not making uneccessary changes this soon to the leap second. In the future they plan to do it 24 hours in advance:

    Although we decided it would be safest for Google's infrastructure to handle the 2016 leap second using a 20-hour smear, the same way we handled the leap seconds in 2012 and 2015, this is not the only smear that works well. Many organizations use smeared clocks, and it would be helpful if the smears were the same. After all, the purpose of clocks is to read the same time in different places.

    We would like to propose to the community, as the best practice for leap seconds in the future, a 24-hour linear smear from noon to noon UTC. We plan to use this smear starting from leap second #38, which is likely to be in 2018.

    Source: https://developers.google.com/time/smear.

  6. Re:Hey look the flow rate is a little high. by arth1 · · Score: 2

    Let's just slow that down. Hope that wasn't important. What is 0.0014% between friends?

    Friends that do low-latency high stake stock trading may have issues if some of competing parties run on a skewed clock (or syncs with something that syncs with something that runs on a skewed clock) and others don't. That affects not only the latency, which is important enough, but as the skew increases until the end when the leap seconds kicks in, and because the leap second is added at midnight UTC while bourses around the world are offset from that, it could mean that some might get a large part of a second more than others at cutoff time, which is an eternity in this context.

  7. Well actually... by watermark · · Score: 4, Funny

    *pushes glasses up* *straightens pocket protector*

    Actually, they would need to run the clocks 0.0013889% slower. If ran the clocks 0.0014% percent slower, they would gain 1.008 seconds instead of just 1 second even.

    Hire me Google. I'll save the internets for you.

  8. Tired of this shit. by LTIfox · · Score: 5, Interesting

    Can we just move to TAI and convert to UTC only when interfacing the meatspace?

    1. Re:Tired of this shit. by LTIfox · · Score: 3, Interesting

      I mean, we have timezone stuff already - just bury those seconds in those tables. Run machine clock at TAI and calculate "local time" by adding, for example, 8hrs35seconds to whatever local timekeep says.

    2. Re:Tired of this shit. by TheRaven64 · · Score: 3, Insightful

      Given that Terrestrial Time exists for astronomers, and the only people for whom leap seconds are useful are astronomers, can we just stop putting leap seconds into UTC?

      --
      I am TheRaven on Soylent News
    3. Re:Tired of this shit. by Xylantiel · · Score: 3, Insightful

      The problem is not so much with UTC but with unix time, as POSIX and NTP have conflicting conventions for handling leap seconds. Well and Google NTP has yet another convention. But the spirit of what you say is correct, we should probably abandon unix time as the fundamental representation on computers in favor of TAI. Software already has to consult a timezone database to convert to local time anyway, why not also require that for conversion to UTC too (to get the leap second offset from TAI).

    4. Re:Tired of this shit. by tricorn · · Score: 3, Insightful

      There are mods to ntpd and the time conversion libraries that do this. System clock is in real seconds since epoch, you only need to worry about leap seconds when converting between system clock and display (wall) time, which also handles time zones and leap years and everything else weird. Anyone who is dividing by 86400 to convert system clock to years, days, hours, minutes, seconds is doing it wrong. You can still divide by 86400 (or 3600 or 60) to display roughly how many hours, minutes or days a particular interval was, of course.

      NTP could support this, or an auxiliary protocol defined, to distribute time conversion table changes (so with leap seconds as well as legal changes to daylight savings or other time zone changes), and to update the current difference between TAI and UTC. This would be useful even if we end up dropping DST or leap second adjustments.

      Currently TAI and UTC differ by 36 seconds. For "current time", simply having that value available is sufficient for most applications that don't store the system clock value, and any that do are most likely already using a proper time conversion library.

      Simply adding the ability to retrieve the clock as either "unix time (UTC-based)" or "elapsed time (TAI-based)" and convert between the two and use either as input to the time conversion routines would make it simple to update existing programs and databases. At the same time, converting once and for all to a 64-bit signed time value for seconds would help immensely with the next big time-handling crisis in about 21 years.

      I fear that Google is just papering over the problem and making things more difficult to properly solve.

    5. Re:Tired of this shit. by tricorn · · Score: 2

      You really want a higher resolution than microseconds. The clock_gettime() system call returns the number of seconds and nanoseconds in two separate values. If you return the number of nanoseconds in a 64-bit signed value, you have a range of only +/- 292 years, which is limiting if you want to use it for historical dates or longer term future dates.

      With a 64-bit signed seconds value you can go +/- 292 billion years. With a 64-bit value for the fractional part, you could easily increase the resolution to attoseconds (1E-18, 60 bits). Both those limits are not very constraining.

  9. Re:O cursÃd spite by Bruce+Perens · · Score: 4, Funny

    Geez, foiled by Slashdot's non-UTF8-ness again.

  10. Re:What, is Google new or something? by green1 · · Score: 2

    Android, or even your desktop OS aren't the point. You are correct that consumer level devices have no problem "fixing" their clock by a second when they discover it. The problem is when you have tons and tons of real time transactions that have to be kept in a very precise order. How do you easily and reliably determine which event happened first if the numerical timestamp isn't sequential? Smearing the second ensures that timestamps, of any precision, remain sequential. This can be crucial for some of these large real-time organizations.
    The only other somewhat practical solution is to implement it like we do leap years, however as leap seconds are not as predictable, you run the risk of whether every system has the correct version of the database with the leap-seconds enumerated, and add extra computing resources on every translation to human readable formats. Google correctly points out that no current consumer OS currently has this capability, and you'll find that data-centre OSes are generally the same. While Google can control one or two of those, they can't guarantee that every device they send something to will also support it.

    The leap second smear is a very elegant solution to a real, and somewhat complex, problem.

  11. Re:It's not that easy by TheRaven64 · · Score: 2
    Time zones compensate for the problem that, in different places in the world, the sun is not at its highest point at the same time. They provide a quantised approximation of a solution so that the sun is at approximately its highest point at noon. Time zones are sufficient wide that the error from being in a different place within a time zone is significantly larger than the error from the small changes in rotation that leap seconds compensate for. If we didn't have leap seconds, this would remain true for about the next thousand years. I propose that in 1,000 years one of the following will hold:
    • The position of the sun will not matter too much to the majority of the human race.
    • Humans will be extinct.
    • Civilisation will have collapsed to the point where a universal time standard is irrelevant.

    It's really hard to come up with a scenario in which the problem that leap seconds solve actually exists.

    --
    I am TheRaven on Soylent News
  12. Re:Hey look the flow rate is a little high. by JaredOfEuropa · · Score: 2

    I suspect very few here will any any sort of sympathy for people who do low latency stock trading. Some even suggested to add time skew or random jitter to stock tickets precisely to prevent this sort of trading.

    --
    If construction was anything like programming, an incorrectly fitted lock would bring down the entire building...
  13. Smeared Seconds by wasteoid · · Score: 2

    Smeared seconds come after sloppy seconds.

  14. Re:Falsehoods Developers Believe About Time by EvilSS · · Score: 2

    Instead of adding a single extra second to the end of the day, we'll run the clocks 0.0014% slower across the ten hours before and ten hours after the leap second, and "smear" the extra second across these twenty hours.

    I wonder why they're "smearing" the time over 20 hours rather than 24, which would seem the more obvious solution.

    Metric

    --
    I browse on +1 so AC's need not respond, I won't see it.
  15. Re:What, is Google new or something? by ZorinLynx · · Score: 2

    >All that will happen is that one second your computer will think it's on time, and a couple seconds later your computer will think that it's a second behind and correct itself against the NTP server.

    The problem here is that not all systems adjust at the same rate. So once all the systems are a second off, they will all be slightly out of sync with each other as they skew their clocks until they're all correct again.

    For us, clocks being under a second out of sync is not a big deal. But for software that has to be well synchronized between hosts, it's a huge deal. So it's better to do it Google's way to keep their infrastructure working reliably.

  16. The 7th voyage by k2r · · Score: 2

    by Stanislaw Lem comes to my mind reading this.
    "Well, the Monday me on Monday night became, Tuesday morning, the Tuesday me, and so on."

    http://webcache.googleusercont...

  17. Re:Hey look the flow rate is a little high. by arth1 · · Score: 2

    If your work depends so precisely on timing, then you should be handling your own timekeeping.

    No, the concern isn't whether your time is correct, but whether it is the same as the time others use.
    That is not solved by adding an atomic clock. In fact, it might make it worse.

  18. Leap Seconds by mbone · · Score: 2

    A smeared second is stupid IMHO. People have had since 1973 to put leap seconds into their software. However, this is how NTP does it, so many computer clocks will have a smeared second even if they don't use Google.

    UTC with leap seconds was set up to support celestial navigation. You can still take out your sextant and determine your position to a km or so using standard clock time. There is still a feeling that that is a useful attribute.

    My personal feeling is that the Internet should just adopt TAI, but I have never gotten anywhere with that proposal.

    Instead, this will go on until some plane crashes or rocket explodes or there is a massive exploit* due to a leap second being incorrectly handled, and then this will be fixed.

    * There are some security protocols that make implicit assumptions about the time being roughly coordinated. On leap second day, those assumptions may be false,

    1. Re:Leap Seconds by paraax · · Score: 2

      Are you really claiming that "roughly coordinated" is at much less than 1 second resolution? If I understand correctly the maximum discrepancy would be half a second to occur at the actual point that the leap second is applied plus any normal deviation of the time systems. For most applications this is acceptable. Anything that is failing to fly or exploding due to this level of difference in time has bigger problems than the time servers being slightly off and is an accident waiting to happen. It would seem that such a sensitive application should be able to determine and adjust to a skewed time from an external source regardless of the reason.

      Further the bugs introduced in the timing logic of numerous applications that don't care so much about timing, just that their clock agrees with the world, makes this the right answer for most applications. For what its worth it sounds like the right answer is to have smeared and non-smeared servers, with the smear period using the same period for the smeared servers. If you need precise time make sure your system can handle a 61 second minute and use the special case non-smeared servers.

  19. Re:Hey look the flow rate is a little high. by MightyYar · · Score: 4, Insightful

    Just make the stocks trade in time-coordinated batches. The batches can still be relatively fast - even every second - just so it is slow enough to stop the stupid games with the speed of communications.

    --
    W..w..W - Willy Waterloo washes Warren Wiggins who is washing Waldo Woo.
  20. Re:It's not that easy by Xylantiel · · Score: 4, Insightful

    It's funny to me that they say the Earth's rotation is "determined" by IERS. No, it is *measured*. A subtle implied difference, but a critical one. The problem here is actually with unix time, not UTC. TAI as an alternative to unix time actually makes pretty decent sense. When was the last time you manually converted from seconds since epoch to day/month/year?

    I think the point is that since time zones are actually updated more frequently for political purposes than leap seconds occur, it makes sense, for network-connected computers at least, to just stuff the leap seconds in the same distribution channels (already done actually) and abandon trying to hack around the clumsy (non-monotonically increasing) definition of unix time.

  21. Re:Hey look the flow rate is a little high. by BronsCon · · Score: 3, Insightful

    This.

    Every trade that occurs within a given interval (I think 1 second is too short still, maybe a minute... or 1/4 hour, since that's often how long quotes are delayed for the average trader) trades at the same price for a given transaction type. The net effect on the market would be the same, we just wouldn't have, for example, two people placing SELL orders for a million shares of something at $100/share and one of them getting $190/share while the other only gets $10/share, which does currently happen.

    --
    APK quotes people (including myself) without context and should not be trusted. Just thought you should know.
  22. Re:Hey look the flow rate is a little high. by _merlin · · Score: 2

    How will you decide on order priority within the one-second batches? Price/time priority? Favours people with fastest connection as they can quote beyond the price they would be filled at when the batch trades and pull their quotes at the last moment if the market moves against them. Price/volume priority? Favours the bigger players who are pushing bigger orders around as well as people with faster connections. That's just two simple, obvious disadvantages to running mini auctions like this. If there was a simple solution, it would've been done already.

    Some exchanges do implement technical measures to try and reduce gaming. For example KRX enforces fill ratio - there's a minimum proportion of your orders that must actually trade or you'll be penalised. This means you can't sit around placing orders and cancelling them all day with no intention of executing. But on the other hand, it means you can't readily quote, displaying an order at the price you're prepared to trade given current market picture and moving it when the market moves. This makes it harder for an investor to know what price they can actually get executed at, and leads to a silly game of trying to hit attractive orders as quickly as possible. So it still makes life harder for actual investors and favours the guy with the lowest latency price feed.

    The main reason for the latency wars is just because margins are so thin. In the past, spreads were tens of cents. A market maker (back then typically one of the big brokers or investment banks) made tens of cents against the theoretical fair price on every security traded. Lower latency allows quoting tighter spreads (you can move quotes quicker if the market moves against you), so the market makers are making far less money per trade - only a few cents per security minus exchange fees and government taxes on every trade. Because the profit per trade is really low, it's a cut-throat competition to get as many profitable trades as possible.

  23. Re:GPS or NIST by Rick+Schumann · · Score: 2

    FFS I'm not doing anything requiring microsecond accuracy if it's within one second or less then it's fine, and unless you're running some sort of mission-critical operation that requires precise alignment to the atomic clock for some reason, you should probably just take your meds and calm the hell down about it.