微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

c# – 错误:使用Redis执行GET超时

我在Redis缓存中有200,000个用户的列表.

当我尝试使用StackExchange.Redis StringGet从Redis缓存中获取该列表时,我收到TimeOut错误

“Timeout performing GET,inst: 1,mgr: ExecuteSelect,err: never,queue: 2,qu: 0,qs: 2,qc: 0,wr: 0,wq: 0,in: 8596,ar: 0,IOCP: (Busy=0,Free=1000,Min=2,Max=1000),WORKER: (Busy=0,Free=4095,Max=4095),clientName: WIN-XYZ”

有人可以解释这些值表示什么:忙,免费,最小和最大?

我已经通过构造函数中的更大程度增加了超时:

redis = ConnectionMultiplexer.Connect(string.Format("{0},allowAdmin=true,connectTimeout=1500000,keepAlive=100",redisConfig));

但是每次我获取用户列表时,我仍然会收到超时.

这不是GET的问题,只是在设置该列表时遇到问题:

Timeout performing PSETEX,err:
never,wr: 1,wq: 1,in: 0,
IOCP: (Busy=0,WORKER:
(Busy=0,Free=8191,Max=8191),clientName: WIN-XYZ

在:

db.StringSet(cacheKey,bytes,slidingExpiration);

我甚至试图提出这里提到的各种超时https://stackexchange.github.io/StackExchange.Redis/Configuration

redis = ConnectionMultiplexer.Connect(string.Format("{0},syncTimeout=600000,connectRetry=3,connectTimeout=600000,keepAlive=180",redisConfig));
                redis.PreserveAsyncOrder = false;

但我仍然收到以下错误

Timeout performing GET,inst: 0,
queue: 0,qs: 0,IOCP:
(Busy=0,WORKER:
(Busy=2,Free=4093,clientName: WIN-XYZ

解决方法

在我的情况下,我重新启动服务器并且它工作,问题是服务器cpu是100%,当用户试图从redis获取凭据时,无法访问,所以…… TIMEOUT并从会话中踢出带有漂亮的错误信息.小心你的进程,也许其中一个是杀死cpu,如果发生这种情况,我可以肯定,Redis会超时.

我的错误信息:

Error Message: Timeout performing GET [email protected],mgr: 
 Inactive,queue: 5,qs: 5,in: 990,clientName: RD0003FXXXXF5D,serverEndpoint: 
 Unspecified/cr.redis.cache.windows.net:6380,keyHashSlot: 14356,IOCP: 
 (Busy=0,WORKER: (Busy=10,Free=8181,Max=8191) (Please take a look at this article for some common client-side issues that can cause 
 timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。

相关推荐