Top posts

Every blog post that took off on Hacker News, ranked by the votes of its best submission. 6,947 posts.

Systems & Performance
Any year
5045

Simpler Backoff

Exponential backoff with jitter is de rigeur for making service calls. This code, or something like it, probably looks really familiar: func do(ctx context.Context) error { const ( maxAttempts = 10 baseDelay = 1 * time.Second maxDelay = 60 * time.Second ) delay := baseDelay for attempt := range maxAttempts { err :=…