Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't see any performance difference between Redisson RLocalCachedMap & RMAP #5854

Closed
rakeshupadhyay323 opened this issue May 9, 2024 · 2 comments
Labels

Comments

@rakeshupadhyay323
Copy link

I am on Redisson version 3.29.0.
I am trying to configure RLocalCachedMap for local reads for the caches that are read heavy.
What I can see is that the time taken by RLocalCachedMap is more or less same as RMap, for multiple reads of same key.

Get is done using: RLocalCachedMap.get(key)

Puts are done using RMap.put(key, value) or RLocalCachedMap.put(key, value) APIs.

RLocalCachedMap is get as:

  • redis.getLocalCachedMap(LocalCachedMapOptions.name(cache));
  • redis.getLocalCachedMap(LocalCachedMapOptions.name(cache) .cacheSize(100).evictionPolicy(EvictionPolicy.LRU).maxIdle(Duration.ZERO).syncStrategy(SyncStrategy.INVALIDATE).timeToLive(Duration.ZERO).reconnectionStrategy(ReconnectionStrategy.CLEAR));

What I believe is that RLocalCachedMap is making network calls every time and not returning anything from local Cache.

Kindly help in suggesting if there is anything wrong or anything that should be done.
We are working on a POC to see if Redisson meets all the Caching needs and a decision will be made based on this.
I have attached the sample code below.

MainClass.java.txt

@mrniko
Copy link
Member

mrniko commented May 9, 2024

RLocalCachedMap isn't compatible with RMap object. You need to use RLocalCachedMap for put operations.

@rakeshupadhyay323
Copy link
Author

I figured it out. There was a problem in code, I was calling map.destroy() after each invocation. This was causing the issue. It is resolved now.

@mrniko mrniko closed this as completed May 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants