---
title: "Troubleshoot Redis timeouts"
slug: "troubleshoot-redis-timeouts"
abstract: "Learn how to solve timeout issues that occur when connecting to Azure Cache for Redis."
---
# Troubleshoot Redis timeouts

Redis timeouts (`RedisTimeoutException`) occur due to various conditions caused by either the server or the client. This topic helps you to find answers for some of the most common timeout scenarios. For more information, you can also refer to [Github](https://stackexchange.github.io/StackExchange.Redis/Timeouts) and [Microsoft Azure documentation](https://docs.microsoft.com/en-gb/azure/azure-cache-for-redis/cache-troubleshoot-timeouts).

<details>
<summary><h2>Server- and client-side issues</h2></summary>

Learn how to solve issues that occur because of an Azure Managed Redis condition, or the virtual machine(s) hosting it.

Possible solutions for infrastructure-related causes:

| Cause | Solution |
| --- | --- |
| Bandwidth/size limits | Monitor Redis Server metrics to check whether you have reached bandwidth/size limits. Possible solutions:<br><br><ul><li>Upgrade pricing [tier](https://docs.microsoft.com/en-us/azure/azure-cache-for-redis/cache-overview) for Redis server.</li><li>Make sure `compression=”true”` is [enabled for Redis session state provider](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/redis-provider-settings-reference.html). Compressing session state data reduces the amount of data that you transfer between the Sitecore instance and the Redis database.</li></ul> |
| High client CPU/memory/bandwidth usage | High CPU, memory, or bandwidth usage can cause the request to not be processed within the `operationTimeoutInMilliseconds` interval and cause a request to time out. Possible solutions:<br><br><ul><li>Investigate what is consuming CPU, memory, and/or bandwidth.</li><li>Upgrade your client to a larger VM or App size with more CPU/memory/bandwidth.</li><li>Make sure `compression=”true”` is [enabled for Redis session state provider](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/redis-provider-settings-reference.html). Compressing session state data reduces the amount of data that you transfer between the Sitecore instance and the Redis database.</li></ul> |
| Server and client application are not in the same region in Azure | We recommend that you have the cache and the client in the same Azure region. For example, timeouts might occur when your cache is in East US but the client is in West US and the request does not complete within the `operationTimeoutInMilliseconds` interval. |

</details>

<details>
<summary><h2>Application issues</h2></summary>

High load can cause `RedisTimeoutException` to occur due to a combination of reasons. Try to adjust your application setup/load to solve the problem.

Possible solutions for application-related causes:

| Cause | Solution |
| --- | --- |
| Thread limits | If the `RedisTimeoutException` message contains the value *Busy* for WORKER and IOCP and these are values greater then the Min value from the message, you can change the parameters for ThreadPoolSizeMonitor that monitors the ThreadPool size and adjusts the Min value to the load:<br><br>> [!important]<br>> Do not make changes directly to the configuration files. Instead, you must create a patch file that performs the required changes during runtime.<br><br><ul><li>Patch parameters under: `sitecore/pipelines/initialize/processor[type="Sitecore.Analytics.Pipelines.Loader.StartThreadPoolSizeMonitor, Sitecore.Analytics"`].</li></ul> |
| Too many requests | The `StackExchange.Redis` client uses a single TCP connection and can only read one response at a time. Even when a first operation times out, it does not stop the data being sent to/from the server. Because of this, it blocks other requests and causes timeouts. In the `RedisTimeoutException` message, the parameter `qs` indicates how many requests are sent but have not processed a response.<br><br>Possible solution:<br><br><ul><li>On the Redis session state provider, use a pool of `ConnectionMultiplexer` objects in your client by adjusting the `connectionPoolSize` setting. This setting controls the number of `ConnectionMultiplexers` created for communication with Redis. The default value is *1*.<br>To find the optimal value for your environment, you could try dividing the number of machine CPU cores by two. For example, use `connectionPoolSize="8"` for 16 core machines.</li></ul> |
| Low values for `operationTimeoutInMilliseconds` or `retryTimoutInMilliseconds` | The Sitecore Redis session state provider uses configuration settings named [operationTimeoutInMilliseconds and retryTimeoutInMilliseconds](https://doc.sitecore.com/xp/en/developers/104/platform-administration-and-architecture/redis-provider-settings-reference.html) for operations. If a call does not complete in the time specified, the Redis client throws a timeout error.<br><br>Possible solution:<br><br><ul><li>Increase the values of the `operationTimeoutInMilliseconds` and/or `retryTimeoutInMilliseconds` settings.</li><li>Make sure the `retryTimeoutInMilliseconds` value is higher than the `operationTimeoutInMilliseconds` value. Otherwise, no retries occur.</li></ul> |

</details>