4 ms·
Make a request. It it fails, try in 1 sec. It it fails, try again in 2sec. If it fails, try again in 4 sec. etc. That's exponential backoff. You can also random
by kevindqc 9y ago
Make a request. It it fails, try in 1 sec. It it fails, try again in 2sec. If it fails, try again in 4 sec. etc. That's exponential backoff. You can also randomize the delay a bit so that if the problem is on your end (so everyone started failing at the same time), you don't get ALL clients retrying at the exact same times.
This is better than trying immediately when it fails or after a set delay. If it hasn't been working in the last 10 tries, why would you expect the 11th request to work. Just wasting resources.
https://en.wikipedia.org/wiki/Exponential_backoff https://en.wikipedia.org/wiki/Exponential_backoff