I am using ABP version 13.0.0. I have enabled Redis cache in the application through the appsettings file. Redis is connected and working in the application.
However, I am facing two issues:-
- The application is responding very slowly.
- I am encountering connection RedisTimeoutException errors simultaneously (screenshot attached below).
I found a solution for the timeout issue, but I am unable to configure it in the ASP.NET Zero application due to its inbuilt code.
Here is the ASP.NET Zero code used to connect to Redis:
Link : "https://github.com/aspnetboilerplate/aspnetboilerplate/blob/dev/src/Abp.RedisCache/Runtime/Caching/Redis/AbpRedisCacheDatabaseProvider.cs"
private ConnectionMultiplexer CreateConnectionMultiplexer() { return ConnectionMultiplexer.Connect(_options.ConnectionString); }
The solution I found is as follows:
var configurationOptions = new ConfigurationOptions { EndPoints = { RedisConnectionString }, Ssl = true, ConnectTimeout = 30000, // Increase timeout SyncTimeout = 30000, // Increase sync timeout ConnectRetry = 5, // Number of times to retry connecting ReconnectRetryPolicy = new ExponentialRetry(5000), // Exponential backoff policy KeepAlive = 30 }; return ConnectionMultiplexer.Connect(configurationOptions);
After implementing this solution, I did not face any RedisTimeoutException issues in my other custom applications.
However, I am still facing slowness in the entire application when Redis is used.
So, please provide both solution and customization as soon as possible.
3 Answer(s)
-
0
Hi,
Could you try using per request redis cache and see if it makes any difference ? https://aspnetboilerplate.com/Pages/Documents/PerRequestRedisCache
-
0
Hi,
Could you try using per request redis cache and see if it makes any difference ? https://aspnetboilerplate.com/Pages/Documents/PerRequestRedisCache
What about the custom configuration I want to apply when creating a connection with Redis?
-
0
Hi,
This is similar to redis usage but just replace a class. Could you share what you want to do as a custom configuration ? It should work with PerRequestRedisCache as well.