0% completed
is the first algorithm a fixed window?
a7mad.3bass
Sep 13, 2023
Regarding the first algorithm, i don't think this is a fixed size algorithm, it's a sliding window, since the start time is reset to current time each time we get a new request that is out of the 1 minute window of the previous limiting period.
also if we take the example shown here in the article to explain the benefits of the sliding window, the first algorithm prevents that case.
|_____t1_t2 | _t3 _t4 ___t8|
the start time will be set to the time of the first t1, t3 and t4 will be throttled because a minute hasn't passed since start time which is set to t1, requests will be accepted only after t1 + 1 minute (demonstrated here as t8) which will also reset the value for start time
1
0
Comments
Alex T10 months ago
Yes, I'm pretty sure it's a rolling window implementation lol