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.

Synchronized consume method in AbstractCacheRateLimiter impact performance

See original GitHub issue

Currently 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:closed
  • Created 5 years ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
addozhangcommented, Aug 1, 2019

@taxus1 yes, by removing synchronized and no any other problem found.

0reactions
taxus1commented, Aug 1, 2019

@addozhang thanks

Read more comments on GitHub >

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

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