Closed javaadpatel closed 5 years ago
I have changed to use the connection multiplexer property like:
.AddOperationalStore(options =>
{
options.RedisConnectionMultiplexer = RedisConnection;
})
will need to test to see if this makes any difference to the timeouts
Hi @javaadpatel
First of all, by providing the SLOWLOG GET
you've exposed the authentication password for your instance, please rotate your key on the instance side, since you provided the instance dns and port in the exception dump
That was my bad, deleted the post, will rotate the credentials shortly. Didn't realize that was the actual password for the instance, thank you for that.
from the log above, I didn't find something useful that relates to the IdentityServer4.Contrib.RedisStore
library itself, it's good to checkout and double check the instance health + topology of your system, is Redis instance far from service that is hosting Identity server ?
Maybe you can start from there and validate your solution, have you just started or it was working successfully and the problem started surfacing ?
The redis instance is an Azure Redis Cache, located in the same region as the service fabric cluster accessing it. I checked the metrics on Azure and I can't see anything in particular from the server load, the cpu is nowhere near maxed out, same for memory.
I noticed the problem while testing that i was getting 404 error's and then when i checked application insights, i found the redis timeout exception.
I am running identity server inside service fabric so there are multiple instances (one on each node) that will be accessing the redis cache for the grant, could that have any effect that causes this issue?
I can't help beyond what I've commented up, sorry for that, this problem seems beyond the library.
I will close the issue for now, and you can reopen it if you found out something that is related to the library itself.
@AliBazzi , no problem, I think the problem has something to do with the library because the exception is coming from a method used in the library
IdentityServer4.Contrib.RedisStore.Stores.PersistedGrantStore.StoreAsync
i'm wondering if it has to do with using redis for more than than just this library because I use it for both data protection and as a distributed cache in the application. If i find anything more I will re-open the issue, thank you for the help.
@AliBazzi you were correct that it was nothing to do with the library, it was because I was using redis for storing the dataprotection key as well and so I had two connections to redis that were blocking each other at random times.
I changed my solution to use the same ConnectionMultiplexer wherever I was connecting to redis (ie. this library config and the data protector) and the timeout issues have dissappeared.
Is there a configuration settings that I am missing in order to optimize the latency of the redis cache. I am getting several timeout exceptions such as below:
my configuration is: