RRateLimiter drift
See original GitHub issueRate limit decreases over the time in highly concurrent environment.
Demo of such drift is on screenshot. Rate there has been limited by only RRateLimiter.

Expected behavior Limit should not change without explicit call of setRate() with new value.
Actual behavior Limit changes over hours. As a workaround I explicitly call setRate() with the same values time to time.
Steps to reproduce or test case Just regular usage, nothing special:
final long limitPerSecond = 115;
final RRateLimiter limiter = redisson.getRateLimiter(name);
limiter.setRate(RateType.OVERALL, limitPerSecond, 1000, RateIntervalUnit.MILLISECONDS);
// ...
limiter.acquire();
Redis version 6.0.5
Redisson version 3.16.1
Redisson configuration
final Config config = new Config();
config.useSingleServer().setAddress(url);
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
RRateLimiter does not provide way to overwrite config #2322
Invoking RRateLimiter.trySetRate twice with different rate-limiter configuration values does not overwrite, since it uses HSETNX instead of ...
Read more >RRateLimiter (Redisson 3.10.6 API) - javadoc.io
Returns current configuration of this RateLimiter object. boolean, tryAcquire(). Acquires a permit only if one is available at the time of invocation.
Read more >Rev Limiter in Drifting
A rev-limiter is to keep you from blowing up your engine! If you've hit the limiter at the redline it's time to shift....
Read more >[ FEATURE | 2005-2006 Drifting Theories | Rev Limit Setting ...
Some drifters of this era can be seen bouncing their rev limiter during their runs. Instead of shifting to another gear, they keep...
Read more >Basic Rate Limiting Pattern | Redis
LANGUAGE, English, Español, Français, Deutsch. © 2022 Redis. Redis and the cube logo are registered trademarks of Redis Ltd. close. Open the Drift...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Fixed! Thanks for report
it’s more or less reproducible. Please check the snippet https://gist.github.com/alim-akbashev/316f56197f099f323ff68cd27b51df78 It’s more simple to reproduce dritft when numbers in config are big, like 30k requests per 30 seconds, but issue appears with lower values as well, it just require more time to drift.
just in case, my config i’ve used to run that snippet: just regular macbook pro (Intel), Redis 6.2.5 in docker, openjdk 16
p.s. while i’ve been typing this comment, limit has dropped down to 29494, so it takes minutes, not hours with such config