StackExchange.Redis Get function throws a TimeoutE

2020-06-24 04:50发布

问题:

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.