Grokking Concurrency in Go
0% completed
Retries with Exponential Backoff
A call to fetch("https://example.com/a") returns the error "service unavailable". Should the program try again, and if it does, how long should it wait first?
Trying again at once is the obvious answer and usually the wrong one. A service that reports itself unavailable is often overloaded, and a client that retries in a tight loop sends it several more requests per millisecond. When a thousand clients do the same, the retries alone can keep the service overloaded after the original problem has passed.
Waiting a fixed time, such as 100 ms, is better but still poor
.....
.....
.....
Like the course? Get enrolled and start learning!
Reading Progress
0%