使用StackExchange.Redis时,我遇到了超时问题。我在stackoverflow上找到的所有东西都试过了。
以下是我得到的内容:Timeout performing GET XXX, inst: 4, mgr: ProcessReadQueue, err: never, queue: 9, qu: 0, qs: 9, qc: 0, wr: 0, wq: 0, in: 65536, ar: 1, IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=35,Free=32732,Min=400,Max=32767)
在几乎所有我只得到queue
和qs
的例外情况中,它的值都变为11
。
我正在使用nuget版本1.0.488
。应用程序托管在Windows Server 2012上的IIS 8.5上。在该计算机上,我们有32GB的RAM,使用率为30-50%。我已将maxmemory
设置为16gb
,将maxheap
设置为22gb。保存到磁盘已禁用。我只将它用作会话存储。
Redis服务器(版本x64-2.8.2402)安装在同一台计算机上。这是我拥有的redis-cli info的网址。
这也是我得到的异常部分:
System.TimeoutException: Timeout performing GET Airports, inst: 1, mgr: ProcessReadQueue, err: never, queue: 4, qu: 0, qs: 4, qc: 0, wr: 0, wq: 0, in: 65536, ar: 1, IOCP: (Busy=0,Free=1000,Min=400,Max=1000), WORKER: (Busy=20,Free=32747,Min=400,Max=32767), clientName: OWNEROR-G875DJG at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 1927 at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 80 at StackExchange.Redis.RedisDatabase.StringGet(RedisKey key, CommandFlags flags) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 1451 at Resvoyage.Services.RedisCacheProvider.GetValue[T](String key) in c:\Development\thomalex\resvoyage\Resvoyage.Services\RedisCacheProvider.cs:line 88
这就是我的连接字符串看起来<add key="LocalRedis" value="127.0.0.1:6379,connectTimeout=25000,allowAdmin=true,password=xxx" />
的方式。 ConnectionTimeout为15000
,我尝试将其加入25000
我在minIoThread
中为IIS增加了machine.config
。以下是我放置的值<processModel autoConfig="true" minIoThreads="50" minWorkerThreads="50" maxWorkerThreads = "100" maxIoThreads = "100"/>
答案 0 :(得分:4)
阅读redis slowlog以查看redis上是否有任何慢查询。也许你正在使用键盘命令? Redis是单线程的,所以一个慢查询可以阻止所有内容,因为客户端不会永远等待redis,你会遇到超时。