logoalt Hacker News

pixl97yesterday at 8:02 PM3 repliesview on HN

Exponential backoff is your friend... too few people use it.


Replies

SAI_Peregrinusyesterday at 9:30 PM

Jittered exponential backoff. You don't want the whole herd to come back at the same time, you have to add timing jitter to the clients.

show 1 reply
r3trohack3ryesterday at 8:51 PM

Don’t forget jitter!

show 2 replies
Quekid5yesterday at 10:48 PM

Exponential is also overkill (even with jitter as others have mentioned).

I seem to remember there was a "you failed 5 PIN entries in a row, please wait 500000 seconds before you retry" on Apple phones. So, you probably also want a sensible max... which makes exponential a bit pointless. Just do a basic fixed delay + (large, e.g. 0.5 x the delay) jitter and you'll be fine for most things. You can add a bit of cumulative delay if it's really costly to do retries.