question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

RRateLimiter drift

See original GitHub issue

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

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:closed
  • Created 2 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
mrnikocommented, Sep 23, 2021

Fixed! Thanks for report

0reactions
alim-akbashevcommented, Sep 1, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found