title: How can I fix this timeout exception in Azure redis cache?
body: <p>We have a web application which uses <code>Microsoft.Web.Redis.RedisSessionStateProvider</code> as the session state provider. We've had no problems with this until recently when suddenly the application is reporting a large number of exceptions as detailed below.</p>
  
  <p>The message suggests some kind of timeout. But I've no idea how to resolve this. The application is an instance of Kentico CMS and we haven't customised its session caching mechanism in any way.</p>
  
  <p><strong>Main exception:</strong></p>
  
  <p>Message:</p>
  
  <blockquote>
    <p>Exception of type 'System.Web.HttpException' was thrown.</p>
  </blockquote>
  
  <p>Stack Trace: </p>
  
  <pre><code>at System.Web.HttpAsyncResult.End() 
  at System.Web.HttpApplication.AsyncEventExecutionStep.OnAsyncEventCompletion(IAsyncResult ar) 
  </code></pre>
  
  <p><strong>Inner exception:</strong></p>
  
  <p>Message: </p>
  
  <blockquote>
    <p>Timeout performing EVAL, inst: 1, mgr: Inactive, err: never, queue: 0, qu: 0, qs: 0, qc: 0, wr: 0, wq: 0, in: 0, ar: 0, IOCP: (Busy=0,Free=1000,Min=2,Max=1000), WORKER: (Busy=3,Free=32764,Min=2,Max=32767), clientName: KSCOMAZUATWEB2</p>
  </blockquote>
  
  <p>Stack Trace: </p>
  
  <pre><code>at StackExchange.Redis.ConnectionMultiplexer.ExecuteSyncImpl[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\ConnectionMultiplexer.cs:line 1927 
  at StackExchange.Redis.RedisBase.ExecuteSync[T](Message message, ResultProcessor`1 processor, ServerEndPoint server) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisBase.cs:line 80 
  at StackExchange.Redis.RedisDatabase.ScriptEvaluate(String script, RedisKey[] keys, RedisValue[] values, CommandFlags flags) in c:\TeamCity\buildAgent\work\3ae0647004edff78\StackExchange.Redis\StackExchange\Redis\RedisDatabase.cs:line 866 
  at Microsoft.Web.Redis.StackExchangeClientConnection.&lt;&gt;c__DisplayClass4.&lt;Eval&gt;b__3() in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 113 
  at Microsoft.Web.Redis.StackExchangeClientConnection.RetryForScriptNotFound(Func`1 redisOperation) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 129 
  at Microsoft.Web.Redis.StackExchangeClientConnection.RetryLogic(Func`1 redisOperation) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 155 
  at Microsoft.Web.Redis.StackExchangeClientConnection.Eval(String script, String[] keyArgs, Object[] valueArgs) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\Shared\StackExchangeClientConnection.cs:line 113 
  at Microsoft.Web.Redis.RedisConnectionWrapper.TryTakeWriteLockAndGetData(DateTime lockTime, Int32 lockTimeout, Object&amp; lockId, ISessionStateItemCollection&amp; data, Int32&amp; sessionTimeout) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisConnectionWrapper.cs:line 182 
  at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemFromSessionStore(Boolean isWriteLockRequired, HttpContext context, String id, Boolean&amp; locked, TimeSpan&amp; lockAge, Object&amp; lockId, SessionStateActions&amp; actions) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisSessionStateProvider.cs:line 272 
  at Microsoft.Web.Redis.RedisSessionStateProvider.GetItemExclusive(HttpContext context, String id, Boolean&amp; locked, TimeSpan&amp; lockAge, Object&amp; lockId, SessionStateActions&amp; actions) in d:\TeamCityBuildAgent\work\f55792526e6d9089\src\RedisSessionStateProvider\RedisSessionStateProvider.cs:line 190 
  at System.Web.SessionState.SessionStateModule.GetSessionStateItem() 
  at System.Web.SessionState.SessionStateModule.PollLockedSessionCallback(Object state) 
  </code></pre>