Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeout error when using redis session #2796

Open
DSXplor opened this issue Sep 15, 2024 · 3 comments
Open

Timeout error when using redis session #2796

DSXplor opened this issue Sep 15, 2024 · 3 comments

Comments

@DSXplor
Copy link

DSXplor commented Sep 15, 2024

I am getting a lot of time out errors after moving our application to redis session state. we usually get either of the following 2 messages:

Timeout performing EVAL (5000ms), next: EVAL, inst: 21, qu: 0, qs: 0, aw: False, bw: SpinningDown, rs: DequeueResult, ws: Idle, in: 0, last-in: 0, cur-in: 54, sync-ops: 579, async-ops: 1, serverEndpoint: xxx.cache.windows.net:6380, conn-sec: 115.79, aoc: 0, mc: 1/1/0, mgr: 9 of 10 available, clientName: wn0sdwk0003PY(SE.Redis-v2.8.0.27420)(Microsoft.Web.RedisSessionStateProvider-v5.1.0.0), IOCP: (Busy=1,Free=999,Min=400,Max=1000), WORKER: (Busy=107,Free=32660,Min=400,Max=32767), v: 2.8.0.27420 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

and

Timeout performing EVAL (5000ms), active: EVAL, next: UNKNOWN, inst: 30, qu: 2, qs: 0, aw: True, bw: CheckingForTimeoutComplete, rs: DequeueResult, ws: Writing, in: 0, last-in: 0, cur-in: 20848, sync-ops: 591, async-ops: 1, serverEndpoint: xxx.redis.cache.windows.net:6380, conn-sec: 118.67, aoc: 0, mc: 1/1/0, mgr: 9 of 10 available, clientName: wn0sdwk0003PY(SE.Redis-v2.8.0.27420)(Microsoft.Web.RedisSessionStateProvider-v5.1.0.0), IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=111,Free=32656,Min=400,Max=32767), v: 2.8.0.27420 (Please take a look at this article for some common client-side issues that can cause timeouts: https://stackexchange.github.io/StackExchange.Redis/Timeouts)

and the stack trace:

StackExchange.Redis.RedisTimeoutException: at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl (StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46) at StackExchange.Redis.RedisDatabase.ScriptEvaluate (StackExchange.Redis, Version=2.0.0.0, Culture=neutral, PublicKeyToken=c219ff1ca8c2ce46) at Microsoft.Web.Redis.StackExchangeClientConnection+<>c__DisplayClass6_0.<Eval>b__0 (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.OperationExecutor (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.StackExchangeClientConnection.Eval (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisConnectionWrapper.TryTakeWriteLockAndGetData (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemFromSessionStore (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at Microsoft.Web.Redis.RedisSessionStateProvider+<GetItemExclusiveAsync>d__19.MoveNext (Microsoft.Web.RedisSessionStateProvider, Version=5.1.0.0, Culture=neutral, PublicKeyToken=null) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<GetSessionStateItemAsync>d__74.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.SessionStateModuleAsync+<AcquireStateAsync>d__65.MoveNext (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd (mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089) at Microsoft.AspNet.SessionState.TaskAsyncHelper.EndTask (Microsoft.AspNet.SessionState.SessionStateModule, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35) at System.Web.HttpApplication+AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication+<>c__DisplayClass285_0.<ExecuteStepImpl>b__0 (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication.ExecuteStepImpl (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a) at System.Web.HttpApplication.ExecuteStep (System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a)

Any ideas on what might be causing these? Thank you

@NickCraver
Copy link
Collaborator

The provider here was not awesome in that the extension model for ASP.NET (non-Core) didn't originally envision remote resources, and predates async. I'd definitely recommend if looking at this it be part of an ASP.NET Core (e.g. .NET 8+) move where most of these extension points and new models are async.

Without this, you're seeing WORKER: (Busy=107,Free=32660,Min=400,Max=32767) which indicates thread exhaustion from all the synchronous calls out.

@philon-msft
Copy link
Collaborator

If you're able to move the app to ASP.NET Core, you can find more guidance on session state management in ASP.NET Core here: https://learn.microsoft.com/en-us/aspnet/core/fundamentals/app-state?view=aspnetcore-8.0#session-state

@DSXplor
Copy link
Author

DSXplor commented Oct 2, 2024

Thanks for the response, I will add this to the reasons to move to Core.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants