Hacker News new | ask | show | jobs
by mFixman 1778 days ago
I'm curious: what's the use case for microsecond-precise timekeeping?
6 comments

Globally distributed, consistent databases. See this Google paper: https://static.googleusercontent.com/media/research.google.c...
There are consensus protocols that allow a grace period for clock skew, and the narrower you can constrain the clock skew, the more transactions per second you can retire, improving both scalability and latency.
To monitor a control loop that ran in <1ms I needed something more precise than milliseconds.

I could have used an in-between time unit, like hundredths of a millisecond, but that would have created embarrassingly long variable names.

I was wondering this as well. FB tech articles never seem to start with a use-case, application or statement of problem.
The question I'm interested in a corrollary of the above question:

What's the use case for microsecond-precise timekeeping, that is of interest to (i.e., benefits) FB?

Certain trading operations require it. I think there's even a regulatory under Mifid2, bit I'm not in the know about the legals.
I work in trading, but mostly on the asian markets, so not sure about mifid. Usually the exchanges seem to give milli to second precision (which is very annoying: if Thailand says it's second-precision to timestamp their order executions but Taiwan says it's milli, our system has to use the most precise when ordering them and we get questions from our own multi market clients about why all these executions are seemingly simultaneous or why our system source marked the request at .480 while the exchange replied with 0.0 for the execution.

But, by no mean, does it mean we use special timing - but now that I say that, I realize I have no clue where our time signal comes from, clearly it wouldn't be the internet because our trading servers aren't exactly directly connected there, we must have an internal ntp sever o_O

Not all exchanges are like this. The JPX exchange in Tokyo provides PTP over dedicated cross-connects, and is super accurate, within +/-25ns. It’s pretty neat seeing a PTP clock from Seiko.
There are plenty of practical applications for it.

Imagine super high speed, high precision robotics, maybe a synthetic fiber layup machine or an exotic milling machine, that moves at 10m/s. If you have 1us of precision and accuracy then you can send movement commands that are precise down to 10um.

But does that really require an absolute time reference?
In these cases mostly not, they require low jitter references and a good counter.

An example that does - I work for IceCube, a big neutrino detector at the South Pole. The detector is essentially a time of flight system that detects emitted light as it propagates through the ice when a neutrino interaction happens. We need good time distribution in the system so we can marry up hits from the 5000 odd sensors in the ice (and successive hits may be nanoseconds apart), and we need good absolute precision because we collaborate with other observatories.

Also pretty much all radio telescopes that do long baseline interferometry need excellent absolute timing. The South Pole Telescope has (I think) the most accurate clock on station, a hydrogen maser-based system. We use GPS.

Neat!
I had the same question - there are obviously a lot of applications for this, but why would a company like FB need it?
Distributed databases I assume