最近公司有個項目,在請求量大的情況下,有大量的錯誤日志是關於redis超時的問題:
Timeout performing SET XXX, inst: 27, mgr: ProcessReadQueue, err: never, queue: 3, qu: 0, qs: 3, qc: 0, wr: 0, wq: 0, in: 15, ar: 1, clientName: XXX, serverEndpoint: 192.168.x.x:6379, keyHashSlot: 944, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=4,Free=4091,Min=4,Max=4095) (Please take a look at this article for some common client-side issues that can cause timeouts: http://stackexchange.github.io/StackExchange.Redis/Timeouts)
在網上找解決方案,有說是redis服務端設置的內存不夠,客戶端連接超時時間設置的長一點,同步時間設置長一點。最后都沒有用,只是定位到了是客戶端的問題,和服務端沒問題。然后繼續找在網上發現
StackExchange.Redis是有超時的bug,最后找到csredis解決了問題。把StackExchange.Redis替換掉了。