StackExchange.Redis.RedisTimeoutException in Azure Redis Session State Provider

Ankit raut 1 Reputation point
2022-05-10T06:05:51.117+00:00

Hello Azure Team,

We have recently implemented Azure Redis Session state provider on DotNet 4.8 framework MVC application. It was working fine for up to 300 logged-in users on the Load test. When we are to step up the load test upto 10k users suddenly we keep getting the timeout exceptions.

Details:
Resource tier: Premium P3 (26 GB)
Region: Central US (Both Redis and Web Instance)

Web config setting :
\

Error :
Method WriteLine -[2022-05-09 11:47:10.107][Error]SetAndReleaseItemExclusive => StackExchange.Redis.RedisTimeoutException: The timeout was reached before the message could be written to the output buffer, and it was not sent (5000ms, inst=611, qs=8, in=0, active=EVAL), inst: 611, qs: 8, in: 0, serverEndpoint: Unspecified/amlaspponeredispremium.redis.cache.windows.net:6380, mgr: 10 of 10 available, clientName: NPR-WEB-02-STAP, IOCP: (Busy=0,Free=1000,Min=32,Max=1000), WORKER: (Busy=715,Free=32052,Min=32,Max=32767), v: 2.0.519.65453 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts) at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in C:\projects\stackexchange-redis\src\StackExchange.Redis\ConnectionMultiplexer.cs:line 2175 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor1 processor, ServerEndPoint server) in C:\projects\stackexchange-redis\src\StackExchange.Redis\RedisBase.cs:line 54 at StackExchange.Redis.RedisDatabase.ScriptEvaluate(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) in C:\projects\stackexchange-redis\src\StackExchange.Redis\RedisDatabase.cs:line 1134 at Microsoft.Web.Redis.StackExchangeClientConnection.<>c__DisplayClass7_0.b__0() at Microsoft.Web.Redis.StackExchangeClientConnection.OperationExecutor(Func1 redisOperation) at Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic(Func1 redisOperation) at Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) at Microsoft.Web.Redis.RedisConnectionWrapper.TryUpdateAndReleaseLock(Object lockId, ISessionStateItemCollection data, Int32 sessionTimeout) at Microsoft.Web.Redis.RedisSessionStateProvider.d__25.MoveNext() User Referrer: npr-web-spp-lol.amla.io Browser Name: Firefox UserId: File Path: D:\SPP\znode-pro-staples\Projects\Libraries\Znode.Libraries.ECommerce.Utilities\Helper\RedisLogger\RedisLogWriter.cs Method Name: WriteLine Line Number: 126 Logger: RedisLogWriter.cs

Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
211 questions
Azure ISV (Independent Software Vendors) and Startups
Azure ISV (Independent Software Vendors) and Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.ISV (Independent Software Vendors) and Startups: A Microsoft program that helps customers adopt Microsoft Cloud solutions and drive user adoption.
111 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,566 Reputation points
    2022-05-10T10:12:52.29+00:00

    Hi @Ankit raut , welcome to Microsoft Q&A forum.

    As per question, your application works fine with 300 logged sessions but when we increase the test load considerably then it times out. It could be due to traffic burst, large key values, high CPU usage etc.

    All cache sizes support range of get request (1 KB size). If the requests cross these sizes cumulatively there are chances for timeouts. Check the below table for more details:

    200613-image.png

    I would request you to increase sharding on the redis cache and try again once as mentioned in the below article:

    Configure Redis clustering for a Premium Azure Cache for Redis instance

    Can you also check the metrics of CPU, connections and Gets as per the Monitor Azure Cache for Redis?