This still isn't what I'd call "safe". Retries are amazing at supporting clients in handling temporary issues, but horrible for helping them deal with consistently overloaded servers. While jitter & exponential backoff help with the timing, they don't reduce the overall load sent to the service. The next step is usually local circuit breakers. The two easiest to implement are terminating the request if the error rate…
Retries – An interactive study of request retry methods
41–50 of 56 posts
Re: Retries – An interactive study of request retry methods
#42Summary of the article: use exponential backoff + jitter for retry intervals. What author didn’t mention: sometimes you want to add jitter to delay the first request too, if the request happens immediately after some event from server (like server waking up). If you don’t do this, you may crash the server, and if your exponential backoff counter is not global you can even put server into cyclic restart.
If you can crash the server with an improperly timed request, then you have a much bigger problem than client-side stuff.
Re: Retries – An interactive study of request retry methods
#43Re: Retries – An interactive study of request retry methods
#44Re: Retries – An interactive study of request retry methods
#45Exponential backoff doesn't apply for successful requests right? The simulation doesn'T reflect that i think. peace
The simulation retries failed requests using various retry strategies, and then after a successful request will wait a configured amount before sending the next request.
Re: Retries – An interactive study of request retry methods
#46Earlier quoted context omitted.
Exponential retries can effectively have a maximum number of requests if the gap between retries gets long enough quickly enough. In practice, the user will refresh or close the page if things look broken for too long.
Oh, please don't do that. Unbounded exponential backoff is an horrible experience, and improves basically nothing. If it makes sense to completely fail the request, do it before the waiting becomes noticeable. If it's something that can't just fail, set a maximum waiting time and add jitter.
Re: Retries – An interactive study of request retry methods
#47Re: Retries – An interactive study of request retry methods
#48Earlier quoted context omitted.
What technology did you use for the animations? I've a bunch of itches I'd like to scratch that would be improved by having some canvas animated explainers or UI but I never clicked with anything. D3 back in the day. A rudimentary look in the source code showed a element but I'm not up to date enough with web standards to guess where to look for that in your JS bundle to guess at the framework!
It uses PixiJS ( https://pixijs.com/ ) for the 2D rendering and GSAP3 ( https://gsap.com/ ) for the animation. The blocks are custom HTMl elements ( https://developer.mozilla.org/en-US/docs/Web/API/Web_compone... ) which I use to encapsulate the logic. I've been thinking about creating a separate repo to house the source code of posts I've finished so people can see it. I don't like all the bundling and minification…
Re: Retries – An interactive study of request retry methods
#49This is one of those things that sort of exposes our industry maturity versus other engineering that's been around longer. You would think by now that the various frameworks for remote calls would have standardized down to include the best practice retry patterns, with standard names, setting ranges, etc. But we mostly still roll our own for most languages/frameworks. And that's full of footguns around DNS caching, w…
There is a school of thought that argues that the best retry pattern is no retry at all, and just get the client to fail and handle that state.
One of the driving arguments is that retries are a lazy way to try to move faults from the client onto the server, and in the process cause more harm (i.e., DDoS).
Sometimes complex means wrong, and all these retry strategies are getting progressively more complex at the expense of hammering servers with traffic way beyond the volume it's designed to handle. How is that a decent tradeoff?
Re: Retries – An interactive study of request retry methods
#50This is one of those things that sort of exposes our industry maturity versus other engineering that's been around longer. You would think by now that the various frameworks for remote calls would have standardized down to include the best practice retry patterns, with standard names, setting ranges, etc. But we mostly still roll our own for most languages/frameworks. And that's full of footguns around DNS caching, w…
> You would think by now that the various frameworks for remote calls would have standardized down to include the best practice retry patterns, with standard names, setting ranges, etc. There is a school of thought that argues that the best retry pattern is no retry at all, and just get the client to fail and handle that state. One of the driving arguments is that retries are a lazy way to try to move faults from the…
Some failures really are random, let's say 0.1% of requests fail. For a sufficiently complex backend/operation, one user request can easily generate 100 internal requests that can fail. If you don't retry, this adds up to a non-negliglible chance that a whole user facing operation fails and all 100 requests have to be retried - you actually increased the number of requests that had to be made! As an extreme example, imagine that during training ChatGPT one request failed, and whole training has to be started from scratch because we don't do retries.