Dear Support,
I moved my app to Azure with Redis. The app randomly turns slow and it seems the reason is releated to Redis usage. I don't see any delay or perfomance issue in Redis resourse (not with metrics, not trying to connect trhough a client) but the application turns very slow. We have a multi seconds delay in StringGet call. Here below the stack of the call causing the issue.
stackexchange.redis!StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl(class StackExchange.Redis.Message,class StackExchange.Redis.ResultProcessor1<!!0>,class StackExchange.Redis.ServerEndPoint,!!0) stackexchange.redis!StackExchange.Redis.RedisDatabase.StringGet(value class StackExchange.Redis.RedisKey,value class StackExchange.Redis.CommandFlags) abp.rediscache!Abp.Runtime.Caching.Redis.AbpRedisCache.TryGetValue(class System.String,class System.Object&) abp.aspnetcore.perrequestrediscache!Abp.Runtime.Caching.Redis.AbpPerRequestRedisCache.TryGetValue(class System.String,class System.Object&) abp!Abp.Runtime.Caching.AbpCacheBase2[System.__Canon,System.__Canon].Get(!0,class System.Func2<!0,!1>) abp!Abp.Runtime.Caching.TypedCacheWrapper2[System.__Canon,System.__Canon].Get(!0,class System.Func2<!0,!1>) abp.zero.common!Abp.Localization.MultiTenantLocalizationDictionary.GetOrNull(value class System.Nullable1<int32>,class System.String)
abp.zero.common!Abp.Localization.MultiTenantLocalizationDictionary.GetOrNull(class System.String)
3 Answer(s)
-
0
Hi @niengineering
The stack trace you provided indicates that the slowdown is not coming from the Redis server itself, but from client-side connection blocking or Thread Pool saturation.
Synchronous Redis calls such as
StringGetcan block the connection and cause multi-second delays. Switch all Redis operations to asynchronous methods such asStringGetAsync.Other parts of the application may be consuming the worker or IOCP threads needed to process Redis responses. Monitor Thread Pool usage and optimize long-running or blocking operations within the application.
Slow reads may occur if very large objects are stored in Redis. Review and limit the size of cached items when possible.
Ensure that all Redis calls in your application are fully asynchronous. This is the most common cause of random multi-second delays with StackExchange.Redis.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Dear aguzhanagir,
what can be the standard functions that use StringGet instead of the async version? E.g. localization, ... and how is the recommended modification?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @niengineering
To better understand the root cause, could you please clarify the following:
- Is your application running on multiple instances in Azure while using Redis?
- Which ASP.NET Boilerplate / ASP.NET Zero version is your application based on?
Additionally, if possible, please send your application logs to [email protected] so we can analyze the issue in more detail.
Thank you
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)