You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/azure-cache-for-redis/cache-management-faq.yml
+16-19Lines changed: 16 additions & 19 deletions
Original file line number
Diff line number
Diff line change
@@ -2,9 +2,6 @@
2
2
metadata:
3
3
title: Azure Cache for Redis management FAQs
4
4
description: Learn the answers to common questions that help you manage Azure Cache for Redis
5
-
6
-
7
-
8
5
ms.topic: faq
9
6
ms.custom: devx-track-csharp, ignite-2024
10
7
ms.date: 04/04/2023
@@ -23,7 +20,7 @@ sections:
23
20
Redis server doesn't natively support TLS, but Azure Cache for Redis does. If you're connecting to Azure Cache for Redis and your client supports TLS, like StackExchange.Redis, then use TLS.
24
21
25
22
>[!NOTE]
26
-
>The non-TLS port is disabled by default for new Azure Cache for Redis instances. If your client does not support TLS, then you must enable the non-TLS port by following the directions in the [Access ports](cache-configure.md#access-ports) section of the [Configure a cache in Azure Cache for Redis](cache-configure.md) article.
23
+
>The non-TLS port is disabled by default for new Azure Cache for Redis instances. If your client doesn't support TLS, then you must enable the non-TLS port by following the directions in the [Access ports](cache-configure.md#access-ports) section of the [Configure a cache in Azure Cache for Redis](cache-configure.md) article.
27
24
>
28
25
>
29
26
@@ -45,14 +42,14 @@ sections:
45
42
46
43
- Set `AbortConnect` to false, then let the ConnectionMultiplexer reconnect automatically.
47
44
- Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request.
48
-
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. In [this Redis discussion](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Best practices development](cache-best-practices-development.md#consider-more-keys-and-smaller-values).
49
-
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid timeouts.
45
+
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. In [this discussion](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Best practices development](cache-best-practices-development.md#consider-more-keys-and-smaller-values).
46
+
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid time-outs.
50
47
- Use at least the default connectTimeout of 5 seconds. This interval gives StackExchange.Redis sufficient time to re-establish the connection if there's a network blip.
51
48
- Be aware of the performance costs associated with different operations you're running. For instance, the `KEYS` command is an O(n) operation and should be avoided. The [redis.io site](https://redis.io/commands/) has details around the time complexity for each operation that it supports. Select each command to see the complexity for each operation.
52
49
- Set `AbortConnect` to false, then let the ConnectionMultiplexer reconnect automatically.
53
50
- Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request.
54
-
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. In [this Redis discussion](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Best practices development](cache-best-practices-development.md#consider-more-keys-and-smaller-values).
55
-
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid timeouts.
51
+
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. In [this discussion](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Best practices development](cache-best-practices-development.md#consider-more-keys-and-smaller-values).
52
+
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid time-outs.
56
53
- Use at least the default connectTimeout of 5 seconds. This interval gives StackExchange.Redis sufficient time to re-establish the connection if there's a network blip.
57
54
- Be aware of the performance costs associated with different operations you're running. For instance, the `KEYS` command is an O(n) operation and should be avoided. The [redis.io site](https://redis.io/commands/) has details around the time complexity for each operation that it supports. Select each command to see the complexity for each operation.
58
55
@@ -76,7 +73,7 @@ sections:
76
73
answer: |
77
74
- Avoid using certain Redis commands that take a long time to complete, unless you fully understand the result of these commands. For example, don't run the [KEYS](https://redis.io/commands/keys) command in production. Depending on the number of keys, it could take a long time to return. Redis is a single-threaded server and it processes commands one at a time. If you have other commands issued after KEYS, they're not be processed until Redis processes the KEYS command. The [redis.io site](https://redis.io/commands/) has details around the time complexity for each operation that it supports. Select each command to see the complexity for each operation.
78
75
- Key sizes - should I use small key/values or large key/values? It depends on the scenario. If your scenario requires larger keys, you can adjust the ConnectionTimeout, then retry values and adjust your retry logic. From a Redis server perspective, smaller values give better performance.
79
-
- These considerations don't mean that you can't store larger values in Redis; you must be aware of the following considerations. Latencies will be higher. If you have one set of data that is larger and one that is smaller, you can use multiple ConnectionMultiplexer instances. Configure each with a different set of timeout and retry values, as described in the previous [What do the StackExchange.Redis configuration options do](cache-development-faq.yml#what-do-the-stackexchange-redis-configuration-options-do-) section.
76
+
- These considerations don't mean that you can't store larger values in Redis; you must be aware of the following considerations. Latencies are higher. If you have one set of data that is larger and one that is smaller, you can use multiple ConnectionMultiplexer instances. Configure each with a different set of time-out and retry values, as described in the previous [What do the StackExchange.Redis configuration options do](cache-development-faq.yml#what-do-the-stackexchange-redis-configuration-options-do-) section.
80
77
81
78
- question: |
82
79
How can I benchmark and test the performance of my cache?
@@ -97,7 +94,7 @@ sections:
97
94
- Test Pipelined GET requests using a 1k payload.
98
95
99
96
>[!NOTE]
100
-
> Run the SET test shown above first to populate cache
97
+
> Run the SET test shown previously first to populate cache
101
98
>
102
99
103
100
`redis-benchmark.exe -h <yourcache>.redis.cache.windows.net -a <yourAccesskey> -t GET -n 1000000 -d 1024 -P 50`
@@ -112,14 +109,14 @@ sections:
112
109
113
110
The thread pool provides new worker threads or I/O completion threads on demand (without any throttling) until it reaches the "Minimum" setting for each type of thread. By default, the minimum number of threads is set to the number of processors on a system.
114
111
115
-
Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool will throttle the rate at which it injects new threads to one thread per 500 milliseconds. Typically, if your system gets a burst of work needing an IOCP thread, it will process that work quickly. However, if the burst is more than the configured "Minimum" setting, there's some delay in processing some of the work as the ThreadPool waits for one of two possibilities:
112
+
Once the number of existing (busy) threads hits the "minimum" number of threads, the ThreadPool throttles the rate at which it injects new threads to one thread per 500 milliseconds. Typically, if your system gets a burst of work needing an IOCP thread, it processes that work quickly. However, if the burst is more than the configured "Minimum" setting, there's some delay in processing some of the work as the ThreadPool waits for one of two possibilities:
116
113
117
114
- An existing thread becomes free to process the work.
118
-
- No existing thread becomes free for 500 ms and a new thread is created.
115
+
- No existing thread becomes free for 500 ms and a new thread is created.
119
116
120
-
Basically, when the number of Busy threads is greater than Min threads, you're likely paying a 500-ms delay before network traffic is processed by the application. Also, when an existing thread stays idle for longer than 15 seconds, it's cleaned up and this cycle of growth and shrinkage can repeat.
117
+
Basically, when the number of Busy threads is greater than Min threads, you're likely paying a 500-ms delay before the application processes the network traffic. Also, when an existing thread stays idle for longer than 15 seconds, it's cleaned up and this cycle of growth and shrinkage can repeat.
121
118
122
-
If we look at an example error message from StackExchange.Redis (build 1.0.450 or later), we see that it now prints ThreadPool statistics. See IOCP and WORKER details below.
119
+
If we look at an example error message from StackExchange.Redis (build 1.0.450 or later), we see that it now prints ThreadPool statistics. See IOCP and WORKER details later in the article.
123
120
124
121
```
125
122
System.TimeoutException: Timeout performing GET MyKey, inst: 2, mgr: Inactive,
@@ -128,10 +125,10 @@ sections:
128
125
WORKER: (Busy=3,Free=997,Min=4,Max=1000)
129
126
```
130
127
131
-
As shown In the example, you see that for IOCP thread there are six busy threads and the system is configured to allow four minimum threads. In this case, the client would have likely seen two 500-ms delays, because 6 > 4.
128
+
As shown In the example, you see that for IOCP thread there are six busy threads and the system is configured to allow four minimum threads. In this case, the client is likely to see two 500-ms delays, because 6 > 4.
132
129
133
130
> [!NOTE]
134
-
> StackExchange.Redis can hit timeouts if growth of either IOCP or WORKER threads gets throttled.
131
+
> StackExchange.Redis can hit time-outs if growth of either IOCP or WORKER threads gets throttled.
135
132
136
133
### Recommendation
137
134
@@ -166,15 +163,15 @@ sections:
166
163
```
167
164
168
165
> [!NOTE]
169
-
> The value specified by this method is a global setting, affecting the whole AppDomain. For example, if you have a 4-core machine and want to set `minWorkerThreads` and `minIoThreads` to 50 per CPU during run-time, use `ThreadPool.SetMinThreads(200, 200)`.
166
+
> The value specified by this method is a global setting, affecting the whole AppDomain. For example, if you have a four core machine and want to set `minWorkerThreads` and `minIoThreads` to 50 per CPU during run-time, use `ThreadPool.SetMinThreads(200, 200)`.
170
167
>
171
168
172
-
It is also possible to specify the minimum threads setting by using the `minIoThreads` or `minWorkerThreads` [configuration setting](/previous-versions/dotnet/netframework-4.0/7w2sway1(v=vs.100) under the `processModel` configuration element in `Machine.config`. `Machine.config` is typically located at `%SystemRoot%\Microsoft.NET\Framework\[versionNumber]\CONFIG\`.
169
+
It's also possible to specify the minimum threads setting by using the `minIoThreads` or `minWorkerThreads` [configuration setting](/previous-versions/dotnet/netframework-4.0/7w2sway1(v=vs.100)) under the `<processModel>` configuration element in `Machine.config`. `Machine.config` is typically located at `%SystemRoot%\Microsoft.NET\Framework\[versionNumber]\CONFIG\`.
173
170
174
171
Setting the number of minimum threads in this way isn't recommended because it's a system-wide setting. If you do set it this way, you must restart the application pool.
175
172
176
173
> [!NOTE]
177
-
> The value specified in this configuration element is a _per-core_ setting. For example, if you have a 4-core machine and want your `minIoThreads` setting to be 200 at runtime, use `<processModel minIoThreads="50"\>`.
174
+
> The value specified in this configuration element is a _per-core_ setting. For example, if you have a four core machine and want your `minIoThreads` setting to be 200 at runtime, use `<processModel minIoThreads="50"\>`.
Copy file name to clipboardExpand all lines: articles/redis/management-faq.yml
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ sections:
36
36
- Set `AbortConnect` to false, then let the ConnectionMultiplexer reconnect automatically.
37
37
- Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request.
38
38
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. In [the Redis discussion](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Best practices development](best-practices-development.md#consider-more-keys-and-smaller-values).
39
-
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid timeouts.
39
+
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid time-outs.
40
40
- Use at least the default connectTimeout of 5 seconds. This interval gives StackExchange.Redis sufficient time to re-establish the connection if there's a network blip.
41
41
- Be aware of the performance costs associated with different operations you're running. For instance, the `KEYS` command is an O(n) operation and should be avoided. The [redis.io site](https://redis.io/commands/) has details around the time complexity for each operation that it supports. Select each command to see the complexity for each operation.
42
42
@@ -54,7 +54,7 @@ sections:
54
54
answer: |
55
55
- Avoid using certain Redis commands that take a long time to complete, unless you fully understand the result of these commands. For example, don't run the [KEYS](https://redis.io/commands/keys) command in production. Depending on the number of keys, it could take a long time to return. Each Redis shard is a single-threaded, and it processes commands one at a time. If you have other commands issued after KEYS, they're not be processed until Redis processes the KEYS command. The [redis.io site](https://redis.io/commands/) has details around the time complexity for each operation that it supports. Select each command to see the complexity for each operation.
56
56
- Key sizes - should I use small key/values or large key/values? It depends on the scenario. If your scenario requires larger keys, you can adjust the ConnectionTimeout, then retry values and adjust your retry logic. From a Redis server perspective, smaller values give better performance.
57
-
- These considerations don't mean that you can't store larger values in Redis; you must be aware of the following considerations. Latencies are higher. If you have one set of data that is larger and one that is smaller, you can use multiple ConnectionMultiplexer instances. Configure each with a different set of timeout and retry values, as described in the previous [What do the StackExchange.Redis configuration options do](development-faq.yml#what-do-the-stackexchange-redis-configuration-options-do-) section.
57
+
- These considerations don't mean that you can't store larger values in Redis; you must be aware of the following considerations. Latencies are higher. If you have one set of data that is larger and one that is smaller, you can use multiple ConnectionMultiplexer instances. Configure each with a different set of time-out and retry values, as described in the previous [What do the StackExchange.Redis configuration options do](development-faq.yml#what-do-the-stackexchange-redis-configuration-options-do-) section.
58
58
59
59
- question: |
60
60
How can I benchmark and test the performance of my cache?
@@ -77,9 +77,9 @@ sections:
77
77
- An existing thread becomes free to process the work.
78
78
- No existing thread becomes free for 500 ms and a new thread is created.
79
79
80
-
Basically, when the number of Busy threads is greater than Min threads, you're likely paying a 500-ms delay before network traffic is processed by the application. Also, when an existing thread stays idle for longer than 15 seconds, it gets cleaned up and this cycle of growth and shrinkage can repeat.
80
+
Basically, when the number of Busy threads is greater than Min threads, you're likely paying a 500-ms delay before the application processes the network traffic. Also, when an existing thread stays idle for longer than 15 seconds, it gets cleaned up and this cycle of growth and shrinkage can repeat.
81
81
82
-
If we look at an example error message from StackExchange.Redis (build 1.0.450 or later), we see that it now prints ThreadPool statistics. See IOCP and WORKER details below.
82
+
If we look at an example error message from StackExchange.Redis (build 1.0.450 or later), we see that it now prints ThreadPool statistics. See IOCP and WORKER details later in the article.
83
83
84
84
```
85
85
System.TimeoutException: Timeout performing GET MyKey, inst: 2, mgr: Inactive,
@@ -115,7 +115,7 @@ sections:
115
115
ThreadPool.SetMinThreads(minThreads, minThreads);
116
116
}
117
117
```
118
-
If you are using .NET Core, you set it in `Program.cs`, just before the call to `WebApplication.CreateBuilder()`:
118
+
If you're using .NET Core, you set it in `Program.cs`, just before the call to `WebApplication.CreateBuilder()`:
119
119
120
120
```csharp
121
121
const int minThreads = 200
@@ -129,12 +129,12 @@ sections:
129
129
> The value specified by this method is a global setting, affecting the whole AppDomain. For example, if you have a machine with four cores and want to set `minWorkerThreads` and `minIoThreads` to 50 per CPU during run-time, use `ThreadPool.SetMinThreads(200, 200)`.
130
130
>
131
131
132
-
It's also possible to specify the minimum threads setting by using the `minIoThreads`` or `minWorkerThreads` [configuration setting](/previous-versions/dotnet/netframework-4.0/7w2sway1(v=vs.100) under the `<processModel>` configuration element in `Machine.config`. `Machine.config` is typically located at `%SystemRoot%\Microsoft.NET\Framework\[versionNumber]\CONFIG\`.
132
+
It's also possible to specify the minimum threads setting by using the `minIoThreads`` or `minWorkerThreads` [configuration setting](/previous-versions/dotnet/netframework-4.0/7w2sway1(v=vs.100)) under the `<processModel>` configuration element in `Machine.config`. `Machine.config` is typically located at `%SystemRoot%\Microsoft.NET\Framework\[versionNumber]\CONFIG\`.
133
133
134
134
Setting the number of minimum threads in this way isn't recommended because it's a system-wide setting. If you do set it this way, you must restart the application pool.
135
135
136
136
> [!NOTE]
137
-
> The value specified in this configuration element is a _per-core_ setting. For example, if you have a machine with four cores and want your `minIoThreads` setting to be 200 at runtime, you would use `<processModel minIoThreads="50">`.
137
+
> The value specified in this configuration element is a _per-core_ setting. For example, if you have a four core machine and want your `minIoThreads` setting to be 200 at runtime, use `<processModel minIoThreads="50"\>`.
0 commit comments