-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Performance/Caching Recommendations? #19
Comments
What is the average latency to your Redis server? Note that Ping() returns Yes, there's no way it should be taking seconds unless there is a problem. As a side note: we generally use a hybrid 2-tier cache: check local memory Marc
|
I added a method to my server API so as to test within the data center and both Going to have to put the hybrid approach in mine as well.... smart ;) Another benchmark, this time of sync instead of async-- Benchmark of StackExchange.Redis (sync) at -c 50
Included the top so that you can see I start getting errors when using sync methods. The error is:
|
It looks like you have hooks for logging in certain places... want me to send any log data your way? |
Sorry for delay; 4 day weekend here. I wonder, then, if this is bandwidth saturation - I don't actually track the bytes sent at the moment. This is all very odd. I don't suppose it can be illustrated in a runnable test rig? (i.e. where I can repro) |
Let me see if i can put some time together to create a test setup in Azure. |
About your side note: "As a side note: we generally use a hybrid 2-tier cache: check local memory |
@gopimails It's not...we've talked about an API for this but it's significant amounts of work. Currently it's in a very-SO-specific library calling StackRedis. We see the general usefulness to everyone for such a system, just a lack of time. |
If you want to use redis just as a plain object cache and need those features like multiple layers of caching etc..., you can take a look at CacheManager which does all that. |
@micahasmith Did you ever discover what was causing the long durations? |
@GaTechThomas not at all! i'm currently investigating if it was from me abusing HttpClient in other parts of my codebase a la https://aspnetmonsters.com/2016/08/2016-08-27-httpclientwrong/ |
Slight update here: there's talk of client-side caching in general with redis here and how it'll interact with library. We're watching the discussion here and will see how the ecosystem wants to head before making calls: https://groups.google.com/forum/#!topic/redis-db/xfcnYkbutDw |
One more update - in case I wrote up how we do caching at Stack Overflow on this library here: https://nickcraver.com/blog/2019/08/06/stack-overflow-how-we-do-app-caching/ - hope that helps the curious finding this. Closing out just to cleanup! |
Background
We run the latest stable redis on linux and our .NET stuff is on Windows Server 2012 all in windows azure, all within the same region.
How do i plan on using Redis? Well, I plan on having it cache the layer that feeds the http Response. Its not output caching because i'm not caching the actual JSON that the api is returning-- it's the layer that builds the object that will end up being returned as JSON.
Story
I'm testing out using StackExchange.Redis for caching instead of our current
ObjectCache
-based impl. For full disclosure I'm going to provide both here:ObjectCache Based
StackExchange.Redis
Here's an example of me using this
IBigCache
interface:Ok ok ok. So the thing that is bothering me is the performance change between the two. Things I know I need to account for when comparing the two:
So I'm thinking "object cache will be faster" as I go into this. The thing that surprise me though is the cost of using Redis here--
Benchmark of ObjectCache at -c 50
Benchmark of StackExchange.Redis (async) at -c 50
It's a lot higher than I expected. Am I doing this wrong?
The text was updated successfully, but these errors were encountered: