Base solution for your next web application
Open Closed

RedisTimeoutException and Application Slowness issue due to Redis #12267


User avatar
0
kansoftware created

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:-

  1. The application is responding very slowly.
  2. 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)