3

I'm using StackExchange.Redis with C# and the StackExchangeRedisCacheClient.Get function throws the following exception.

myCacheClient.Database.StringGet(txtKey.Text)

'myCacheClient.Database.StringGet(txtKey.Text)' threw an exception of type 'System.TimeoutException' StackExchange.Redis.RedisValue {System.TimeoutException}

Message

"Timeout performing GET hi, inst: 12, mgr: ExecuteSelect, err: never, queue: 2, qu: 2, qs: 0, qc: 0, wr: 0, wq: 1, in: 0, ar: 0, IOCP: (Busy=0,Free=1000,Min=4,Max=1000), WORKER: (Busy=3,Free=4092,Min=4,Max=4095), clientName: ATT-AP-R8-F8WZD" string

Following is the method that I use to retrieve values from the Redis Database.

 protected void btnGetValue_Click(object sender, EventArgs e)
{
    try
    {
        var serializer = new NewtonsoftSerializer();
        var myCacheClient = new StackExchangeRedisCacheClient(serializer);

        var value = myCacheClient.Get<string>(txtKey.Text);
    }
    catch (Exception ex)
    {
        throw ex;
    }
}

All the other functions such as Add, GetInfo & FlushDb are working fine.

9
  • What is StackExchangeRedisCacheClient? because: that isn't raw StackExchange.Redis; how big is the payload that you are fetching here? (debug object {key} in redis-cli is a fair way of estimating this; look at the serializedlength:{...} field) Commented Aug 26, 2015 at 11:41
  • I used StackExchange.Redis.Extensions.Newtonsoft package as client (nuget.org/packages/StackExchange.Redis.Extensions.Newtonsoft/…). I tried raw StackExchange.Redis as well (nuget.org/packages/StackExchange.Redis/1.0.481) but it throws the same error when fetching. The payload was only a string with 3 characters (key: foo, value: bar) :) Commented Aug 26, 2015 at 12:30
  • That's odd; how does get foo behave in redis-cli? fast? or slow? also: is it possible that other redis clients on the same node are blocking you? for example, an unrelated app calling keys {something} ? (slowlog get can be helpful here); likewise, is it possible that this relates to persistence / replication? (the server log can help identify this) Commented Aug 26, 2015 at 13:25
  • redis-cli is working fast and fine. Can you check if I'm missing something in the configurations? <redisCacheClient allowAdmin="true" ssl="false" connectTimeout="5000" database="0"> <hosts> <add host="127.0.0.1" cachePort="6379" /> </hosts> </redisCacheClient> Commented Aug 27, 2015 at 5:46
  • 1
    Ah! I see; for some reason your data is queued unsent (qu: 2), with no writer (wr: 0). I have never seen that (at least, not in the production builds for the last ... forever), so frankly: I would have to investigate. This is almost certainly either a bug, or a problem in the initial handshake. I will have to look. Commented Aug 27, 2015 at 9:13

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.