Using Go for NTPsec

Eric S. Raymond esr at thyrsus.com
Tue Jun 29 20:41:30 UTC 2021


Sanjeev Gupta via devel <devel at ntpsec.org>:
> This is a follow on to Eric's email a few hours ago, I am keeping that
> thread clean.
> 
> (The last 3GL I programmed in was Fortran, and not the 77 version.  I can
> read bash scripts and C pseudo-code)
> 
> The literature I can find speaks of Go GC being improved in 1.5, such that
> the STW phase (the "sweep") is now less than 1ms.  This is impressive, but
> for NTP, this places a lower bound on our jitter.
> 
> What am I missing?

Well, first, the historical target for accuracy of WAN time service is
more than an order of magnitude higher than 1ms.  The worst-case jitter
that could add would be barely above the measurement-noise floor at worst,
and more probably below it.

Second, Go 1.5 was a long time ago.  STW pauses are much shorter now.
The graph at https://github.com/lni/dragonboat indicates that even
under heavy load STW in GO 1.12 never went above 600 microseconds and
is usually somewhat below 400.  We can expect this figure to decrease
rathrr than increase in the future - reducing latency spikes is high
on the Go development team's objectives.

Third, most of the code isn't stall-sensitive at all.  There are a
couple of critical regions that need to be guarded, which I think we
can accomplish by eirther (a) turning GC off before we enter them and
turning it on again after, or (b) some Lampson-like tricks for
tetecting when the interval was interrupted by GC and discarding any
resulting sample.

I don't think we'll ever need to go to that third level, but we can
deal with it if we need to.
-- 
		<a href="http://www.catb.org/~esr/">Eric S. Raymond</a>




More information about the devel mailing list