zlacker

[parent] [thread] 7 comments
1. oblio+(OP)[view] [source] 2023-07-01 22:49:15
What do you mean?
replies(3): >>jyxent+w >>wolfga+V >>8organ+B2
2. jyxent+w[view] [source] 2023-07-01 22:54:30
>>oblio+(OP)
Adding some randomization to the exponential backoff times to avoid the thundering herd problem: https://en.wikipedia.org/wiki/Thundering_herd_problem
3. wolfga+V[view] [source] 2023-07-01 22:58:36
>>oblio+(OP)
Say you have a bug that caused 100,000 HTTP requests to hang, and you kick the node and make them all fail at once. One second later, 100,000 clients suddenly retry simultaneously, causing a huge spike in load which makes most of their requests fail. They use exponential backoff, so two seconds after that, 99,000 clients retry, causing a huge spike in load that makes most of their requests fail. Four seconds after that, 98,000 clients retry...

If you introduce a bit of randomness into the retry timing (say, multiply by 1.8~2.2 instead of a straight doubling), that thundering herd will spread itself out and be much easier to recover from.

4. 8organ+B2[view] [source] 2023-07-01 23:12:37
>>oblio+(OP)
Jitter is a little randomness in how long clients wait between retries. It ensures that you don't have a "thundering herd" all retrying at the same time. Imagine if your API used exponential backoff of [1s, 2s, 4s, 8s, ...] and a large group of requests gets a retryable error at t=0. They will all retry at exactly t=1, t=2, etc. If the group is large enough that repeated surge of requests can knock you offline.

There's nasty form of this where the site is offline for a bit and then all the clients rush their requests in when it comes back online. The client requests are all coordinated on the site recovery time and end up overloading the site with their coordinated retries.

replies(4): >>henry2+X5 >>nights+6j >>doomle+uo >>bezout+Ra1
◧◩
5. henry2+X5[view] [source] [discussion] 2023-07-01 23:42:31
>>8organ+B2
I enjoyed your comment a lot. Interesting to think that abstract structures like a load balanced webserver have a simil to the fundamental frequency observer in physical structure
◧◩
6. nights+6j[view] [source] [discussion] 2023-07-02 01:42:26
>>8organ+B2
Also useful in caching mechanisms.
◧◩
7. doomle+uo[view] [source] [discussion] 2023-07-02 02:41:32
>>8organ+B2
Ah, so it’s like CDMA in WLAN, TIL
◧◩
8. bezout+Ra1[view] [source] [discussion] 2023-07-02 12:04:08
>>8organ+B2
TIL about jitter
[go to top]