Synchronized consume method in AbstractCacheRateLimiter impact performance
See original GitHub issueCurrently we are using 1.7.2 which is similar with AbstractCacheRateLimiter
in latest version. The repository we use is redis.
We did performance test. With 1.7.2, the TPS is 600+
. After remove synchronized
, it is up to 2000+
.
In AbstractCacheRateLimiter
, it has a synchronized
method. In redis implementation, there is no object shared among threads. This method is invoked by each incoming request.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (1 by maintainers)
Top Results From Across the Web
Detailed Explanation of Guava RateLimiter's Throttling ...
Use a static method of RateLimiter to create a limiter, and set the number of tokens to be placed into the bucket to...
Read more >Managing State for Failure Resiliency in Network Function ...
We tested for varying state update patterns to compare the impact of using synchronous (sync) and asynchronous (async) state update operations.
Read more >RateLimiter (Guava: Google Core Libraries for Java 19.0 API)
Creates a RateLimiter with the specified stable throughput, given as "permits per second" (commonly referred to as QPS, queries per second), and a...
Read more >LeafReader (Lucene 8.2.0 API) - Apache Lucene
If your application requires external synchronization, you should not synchronize on the ... All Methods Instance Methods Abstract Methods Concrete Methods ...
Read more >How to handle race condition and data synchronization for ...
How to handle race condition and data synchronization for distributed rate limiter? ... For example, 2 concurrent requests may concurrently read and write...
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 FreeTop 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
Top GitHub Comments
@taxus1 yes, by removing
synchronized
and no any other problem found.@addozhang thanks