-
Notifications
You must be signed in to change notification settings - Fork 158
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
Fallback MGetCache to MGet when DisableCache=true #567
Comments
Hi @jo-me, Thank you for sharing your test results. Unlike Could you also test |
Hmm,
but both were on par with the MgetCache variant with DisableCache=true My client initialization is like this btw:
|
When I look at redis monitor I cannot confirm what you're saying. One difference I see in redis monitor though is the connection: go-redis: rueidis: maybe that is causing the unexpected behavior? |
Ohhhh, I think I know where the behavior is coming from. When I remove the MaxFlushDelay from the client config (or set ForceSingleClient to true) I see the single GET requests that MGetCache is doing when DisableCache=true. Removing MaxFlushDelay also "fixed" the performance problem that I was seeing. It is now comparable to go-redis. Anyway, falling back to MGET in the DisableCache=true mode would probably be a good idea as it is what you'd expect as a user and is also faster. What abound when clientside caching is enabled though? Shouldnt all keys missing from the local cache be requested at once?
|
That's weird.
500 milliseconds is indeed too large. I recommend 20 microseconds (#156 (comment)).
Yes, that is an optimization we can do and that isn't easy to implement. |
@rueian Do we modify this in the helper? How can we check the clientOption DisableCache is set to true in that scope? |
Resolved. |
Hi,
I'm playing around with rueidis as drop-in replacement for redis-go, but I'm seeing some strange performance in a (local) comparison.
On my dev machine I have redis running in docker and a simple API service that checks redis based on the IDs given in the API requests.
All tests were done with Rueidis v1.0.38 and go-redis v9.5.3 using go 1.22.3.
For my simple test I'm setting 5 values in redis with~2KB each and hammer my API with k6 to see how many requests per second I get when I request all 5 elements over and over.
Without any caching involved, I have around 50 rps (have to recreate the 5 elements).
With go-redis I have around 25000 rps
Now, when switching to ruedis I tried out 3 different configurations:
MGetCache with client option DisableCache:true: ~500 rps
MGetCache with client option DisableCache:false: ~50000rps
DoMultiStream: ~30000 rps
So, with client-side caching the rps are considerably higher as expected (although the difference is not that much probably due to redis being on the same host), but with disabled client-side cache, there seems to be something strange going on.
Aside from the DisableCache option the code is exactly the same.
To my understanding Mget and Mgetcache (without client-side caching) should behave identically and I would have expected a similar result as with go-redis.
Any idea what could be the issue?
Thanks!
Jochen Mehlhorn [email protected], Mercedes-Benz Tech Innovation GmbH
Provider Information
The text was updated successfully, but these errors were encountered: