-
Notifications
You must be signed in to change notification settings - Fork 166
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
阿里云主从redis出现链接超时,但是监控显示一切正常 #197
Comments
怎么不用单例啊? |
我也出现这种情况, 一般都是在站点发布之后出现, 很奇怪 |
确保不是被redis防火墙拒绝,min pool size设置为1,避免预热导致防火墙错误判断为攻击而拒绝。 请确保网络环境通畅,健康。 |
min pool size 和 max pool size 怎么理解呢 |
我的也阿里云Redis,出现跟楼主一样的情况,我使用的单例注入。每次暂停站点,更新文件后重新开启,都会出现链接超时的问题,然后刷新1,2次就好了。不知道为什么? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
错误所示:
2024-07-31 21:23:42.156 +08:00 [ERR] Connection id "0HN57R8AORGCD", Request id "0HN57R8AORGCD:00000001": An unhandled exception was thrown by the application.
System.Exception: 【xsusercenter.redis.rds.aliyuncs.com/18】Status unavailable, waiting for recovery. Connect to redis-server(xsusercenter.redis.rds.aliyuncs.com:6379 -> Unspecified/xsusercenter.redis.rds.aliyuncs.com:6379) timeout, DEBUG: Dns.GetHostEntry(xsusercenter.redis.rds.aliyuncs.com)=System.Net.IPHostEntry
---> System.TimeoutException: Connect to redis-server(xsusercenter.redis.rds.aliyuncs.com:6379 -> Unspecified/xsusercenter.redis.rds.aliyuncs.com:6379) timeout, DEBUG: Dns.GetHostEntry(xsusercenter.redis.rds.aliyuncs.com)=System.Net.IPHostEntry
at FreeRedis.Internal.DefaultRedisSocket.Connect()
at FreeRedis.Internal.DefaultRedisSocket.Write(CommandPacket cmd)
at FreeRedis.RedisClient.SingleInsideAdapter.<>c__DisplayClass5_0
1.<AdapterCall>b__0() at FreeRedis.RedisClient.LogCallCtrl[T](CommandPacket cmd, Func
1 func, Boolean aopBefore, Boolean aopAfter)at FreeRedis.RedisClient.LogCall[T](CommandPacket cmd, Func
1 func) at FreeRedis.RedisClient.SingleInsideAdapter.AdapterCall[TValue](CommandPacket cmd, Func
2 parse)at FreeRedis.RedisClient.Call(CommandPacket cmd)
at FreeRedis.Internal.RedisClientPoolPolicy.PrevReheatConnectionPool(ObjectPool
1 pool, Int32 minPoolSize) --- End of inner exception stack trace --- at FreeRedis.Internal.ObjectPool.ObjectPool
1.GetFree(Boolean checkAvailable)at FreeRedis.Internal.ObjectPool.ObjectPool
1.Get(Nullable
1 timeout)at FreeRedis.RedisClient.PoolingAdapter.GetRedisSocket(CommandPacket cmd)
at FreeRedis.RedisClient.PoolingAdapter.<>c__DisplayClass10_0
1.<<AdapterCallAsync>b__0>d.MoveNext() --- End of stack trace from previous location --- at FreeRedis.RedisClient.LogCallAsync[T](CommandPacket cmd, Func
1 func)at InternalApi.Controller.PhoneController.GetRedis(String redisConnStr, String num) in /app/InternalApi/Controller/PhoneController.cs:line 41
at InternalApi.Controller.PhoneController.QueryPhone(String phone) in /app/InternalApi/Controller/PhoneController.cs:line 74
at lambda_method24(Closure, Object)
at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.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__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker) at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger) at Swashbuckle.AspNetCore.SwaggerUI.SwaggerUIMiddleware.Invoke(HttpContext httpContext) at Swashbuckle.AspNetCore.Swagger.SwaggerMiddleware.Invoke(HttpContext httpContext, ISwaggerProvider swaggerProvider) at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context) at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplication
1 application)发生异常时的阿里云监控均是正常
亦未找到慢读取情况
问题发生时间大约是7月31日21点-21点40,问题发生后短时间无法解决,故将redis读取调整为读取数据库
具体api代码如图
是否能有更具体的相关信息提现是因为什么而导致的连接超时,或者出现问题时应该如何去定位这个问题的根本原因
The text was updated successfully, but these errors were encountered: