StackExchange.Redis icon indicating copy to clipboard operation
StackExchange.Redis copied to clipboard

StackExchange redis exception

Open TranNghia1998 opened this issue 4 years ago • 2 comments

I having issue connect redis. How to way solution this problem? Below issue:

StackExchange.Redis.RedisTimeoutException: Timeout performing SCAN (5000ms), next: SCAN, inst: 0, qu: 0, qs: 2, aw: False, rs: ReadAsync, ws: Idle, in: 0, in-pipe: 0, out-pipe: 0, serverEndpoint: 27.71.234.142:7778, mc: 1/1/0, mgr: 10 of 10 available, clientName: DESKTOP-KUODPNU, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=2,Free=32765,Min=4,Max=32767), v: 2.2.88.56325 (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.CursorEnumerable`1.Enumerator.ThrowTimeout(Message message) in /_/src/StackExchange.Redis/CursorEnumerable.cs:line 244
   at StackExchange.Redis.CursorEnumerable`1.Enumerator.SlowNextSync() in /_/src/StackExchange.Redis/CursorEnumerable.cs:line 190
   at System.Linq.Enumerable.SelectEnumerableIterator`2.ToList()
   at WebApiTool.Controllers.CompareDbController.RedisCompare() in E:\vihat\vihat_local\WebApiTool\WebApiTool\Controllers\CompareDbController.cs:line 43
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.TaskOfIActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeInnerFilterAsync()
--- End of stack trace from previous location ---
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeFilterPipelineAsync>g__Awaited|20_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Awaited|17_0(ResourceInvoker invoker, Task task, IDisposable scope)
   at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|6_0(Endpoint endpoint, Task requestTask, ILogger logger)
   at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
   at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext)
   at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider)
   at Microsoft.AspNetCore.Diagnostics.DeveloperExceptionPageMiddleware.Invoke(HttpContext context)
HEADERS
=======
Accept: */*
Connection: keep-alive
Host: localhost:5280
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.110 Safari/537.36
Accept-Encoding: gzip, deflate, br
Accept-Language: vi,en-US;q=0.9,en;q=0.8
Cookie: _gcl_au=1.1.1367415527.1633408315; _ga=GA1.1.397988353.1633408315; style=null; __tawkuuid=e::localhost::k3csoelDEcoYYIDaLg+zwSerHn1k1sy2qglX+BnLmadHQfmux2e4VQlUSKbfY+P8::2; ai_user=0llmm|2021-12-14T06:40:12.817Z; ai_session=fc/0t|1640049698586|1640052750445.1
Origin: http://localhost:5280
Referer: http://localhost:5280/swagger/index.html
Content-Length: 0
sec-ch-ua: " Not A;Brand";v="99", "Chromium";v="96", "Google Chrome";v="96"
sec-ch-ua-mobile: ?0
sec-ch-ua-platform: "Windows"
Sec-Fetch-Site: same-origin
Sec-Fetch-Mode: cors
Sec-Fetch-Dest: empty

TranNghia1998 avatar Dec 21 '21 02:12 TranNghia1998

Well, it looks like a real timeout from here, after 5 seconds. There are three possibilities:

  1. the server really didn't respond
  2. the network layer has high latencies
  3. the client library dropped the ball

Now, 3 is a possibility, but so are 1 and 2. I don't know what the setup is here, but: do you normally have fast access to the redis server here? Is there anything in the "slowlog" on the server?

mgravell avatar Dec 21 '21 09:12 mgravell

See Marc's advice above - this looks like a long-distance connection from a local desktop under low load, so a proper timeout indeed. For this case, a higher than default timeout is probably warranted.

NickCraver avatar Feb 08 '22 03:02 NickCraver