3

I am trying to save a 90 KB pdf file into Azure Redis Cache using StackExchange.Redis client. I have converted that file into byte array and tried to save it using stringSet method and received error.

Code:

byte[] bytes = File.ReadAllBytes("ABC.pdf"); cache.StringSet(info.Name, bytes); --> This Line throws exception "Timeout performing SET {Key}, inst: 0, mgr: Inactive, queue: 2, qu=1, qs=1, qc=0, wr=1/1, in=0/0".

Kindly Help.

Ravi Kanasagra
  • 591
  • 1
  • 8
  • 22

1 Answers1

2

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.

Few questions: 1. Is your client running in the same region as the cache? Running it from your dev box would introduce additional latency and cause timeouts. 2. How often do you get the exception? Does it succeed any time? 3. You can also contact azurecache@microsoft.com with your cache name, time (with time zone) range in which you see the timeouts and if possible a console app that would help to repro the issue.

Hope this helps, Deepak

details about the error codes from this thread: #83 inst: in the last time slice: 0 commands have been issued mgr: the socket manager is performing "socket.select", which means it is asking the OS to indicate a socket that has something to do; basically: the reader is not actively reading from the network because it doesn't think there is anything to do queue: there are 73 total in-progress operations qu: 6 of those are in unsent queue: they have not yet been written to the outbound network qs: 67 of those have been sent and are awaiting responses from the server qc: 0 of those have seen replies but have not yet been marked as complete due to waiting on the completion loop wr: there is an active writer (meaning - those 6 unsent are not being ignored) in: there are no active readers and zero bytes are available to be read on the NIC

Deepak
  • 2,223
  • 17
  • 15
  • To Resolve the error, I have increased the syncTimeout to 10 Seconds. – Ravi Kanasagra Nov 05 '14 at 09:48
  • I am consuming the azure redis cache service from my local machine is not in Azure network. Is this ok? – Ravi Kanasagra Nov 05 '14 at 09:49
  • Do you have documentation related to meaning of "queue: 2, qu=1, qs=1, qc=0, wr=1/1, in=0/0".". Kindly share with me. It will be very much help full. As I find different error every time. – Ravi Kanasagra Nov 05 '14 at 09:50
  • increasing timeout when on local machine is fine, but in prod you should experiment with removing it so as to catch any high latency issues. For doc this thread https://github.com/StackExchange/StackExchange.Redis/issues/83 has some details. – Deepak Nov 05 '14 at 20:54
  • 1
    I have seen this pattern if (Debugger.IsAttached) syncTimeout = 5000; also at few places. – Deepak Nov 05 '14 at 20:55
  • How do you increase the syncTimeout? – DarthVegan Jan 21 '15 at 16:55
  • 1
    This document here explains about various configuration options: https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Configuration.md – Deepak Jan 28 '15 at 23:34
  • I am getting following exception Timeout performing HGET KeyName, inst: 0, mgr: ExecuteSelect, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=1,Free=1022,Min=4,Max=1023) – Pragmatic Apr 10 '16 at 14:32
  • I'm running my redis instance inside docker container, on not so powerful computer and it's performance was too slow for default settings. I just want to add that increasing timeout really helped in my case. – wirher May 31 '18 at 21:13
  • Documentation of different parms inst: 0, queue: 2, qu: 1, qs: 1, qc: 0, wr: 1, wq: 1, in: 0, ar: 0 is at : https://stackexchange.github.io/StackExchange.Redis/Timeouts – Ganesh Todkar Aug 19 '20 at 10:55