TimeoutException exception in StackExchange Redis .NET Library

妖精的绣舞 提交于 2019-12-12 00:46:42

问题


We are using stackexchange.redis.dll but recently I am seeing lots of below exception in log. Any idea what's getting wrong?

TimeoutException exception: Timeout performing EXISTS key1234, inst: 1, mgr: Inactive, err: never, queue: 10, qu: 0, qs: 10, qc: 0, wr: 0, wq: 0, in: 2304, ar: 0, IOCP: (Busy=4,Free=996,Min=4,Max=1000), WORKER: (Busy=15,Free=4080,Min=4,Max=4095), clientName: testclient

Info:

due to some requirement, I am fetching all existing keys from Redis cache by saying connectioncontext.Server("host").Keys() and in Redis document somewhere I saw that, fetching keys frequently can lead to decreasing cache performance. But I am fetching the keys only 4 times / day (I mean in application). Will that cause any issue at all?

Please let me know.


回答1:


Timeout performing SET {Key}, inst: 0, mgr: Inactive, queue: 2, qu=1, qs=1, qc=0, wr=1/1, in=0/0 means, it has sent one request (qs), there is another request that's in unsent queue (qu), while there is nothing to be read from the network. there is an active writer meaning the one unsent is not being ignored. Basically, there is a request sent and waiting for the response to be back.

I fixed it doing the following: I set the connection timeout to 30 seconds,

ConnectTimeout = 30000, // 30 seconds
SyncTimeout = 20000, // 20 seconds 
ConnectRetry = 3


来源:https://stackoverflow.com/questions/37660545/timeoutexception-exception-in-stackexchange-redis-net-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!