3 ms·
This is like a capacitor discharging. I had always considered this a variant of token bucket with exponential instead of linear decay.
by alphazard 2y ago
This is like a capacitor discharging. I had always considered this a variant of token bucket with exponential instead of linear decay.
- fanf2 2y agoThe main difference from my point of view is the EWMA produces a measurement of the rate, whereas token bucket only produces the result of a comparison with the limit. If you don’t need the actual value of the rate then you can save a lot of time and space by using GCRA instead https://dotat.at/@/2024-08-30-gcra.html https://dotat.at/@/2024-08-30-gcra.html
- ted_dunning 2y agoIf doing a small amount of arithmetic and keeping 4 bytes (or less) additional memory per client is "a lot of time and space", you may need to rethink your priorities. It is very, very unusual for any kind of request to anything to take a time within many orders of magnitude of how long exponential averaging will take. The difference between a GCRA implementation and complex multi-exponential average will be nanoseconds.