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
+15-14Lines changed: 15 additions & 14 deletions
Original file line number
Diff line number
Diff line change
@@ -54,7 +54,7 @@ sections:
54
54
- question: |
55
55
Should I enable the non-TLS/SSL port for connecting to Redis?
56
56
answer: |
57
-
Redis server doesn't natively support TLS, but Azure Cache for Redis does support TLS. If you connect to Azure Cache for Redis with a client like StackExchange.Redis that supports TLS, then use TLS.
57
+
Redis server doesn't natively support Transport Layer Security (TLS), but Azure Cache for Redis does support TLS. If you connect to Azure Cache for Redis with a client like StackExchange.Redis that supports TLS, then use TLS.
58
58
59
59
>[!NOTE]
60
60
>The non-TLS port is disabled by default for new Azure Redis instances. If your client doesn't support TLS, enable the non-TLS port by following the directions at [Access ports](cache-configure.md#access-ports).
@@ -89,19 +89,18 @@ sections:
89
89
- Be aware that Redis is an *in-memory* data store, and data loss can occur in some scenarios. For more information, see [Troubleshoot data loss in Azure Cache for Redis](cache-troubleshoot-data-loss.md).
90
90
- Develop your system so it can handle connection blips caused by [patching and failover](cache-failover.md).
91
91
- Use Premium-tier Azure Redis instances for better network latency and throughput, because they have better hardware for both CPU and network.
92
-
- question: |
93
-
What are some StackExchange.Redis best practices?
94
-
answer: |
92
+
93
+
### StackExchange.Redis best practices
94
+
95
95
- Set `AbortConnect` to false, then let the `ConnectionMultiplexer` reconnect automatically.
96
96
- Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request.
97
97
- Redis works best with smaller values, so consider chopping up bigger data into multiple keys. For example, in [What is the ideal value size range for redis?](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ), 100 kb is considered large. For more information, see [Consider more keys and smaller values](cache-best-practices-development.md#consider-more-keys-and-smaller-values).
98
-
- Configure your [ThreadPool settings](#what-are-some-threadpool-growth-details-and-recommendations-) to avoid timeouts.
98
+
- Configure your [ThreadPool settings](#important-details-about-threadpool-growth) to avoid timeouts.
99
99
- Use at least the default `connectTimeout` of 5 seconds. This interval gives StackExchange.Redis sufficient time to reestablish the connection if there's a network blip.
100
100
- Be aware of the performance costs associated with different operations you run. For instance, the `KEYS` command is an O(n) operation and should be avoided. The [redis.io](https://redis.io/commands/) site has details about the time complexity of each operation it supports. Select each command to see the complexity for each operation.
101
101
102
-
- question: |
103
-
What are some ThreadPool growth details and recommendations?
104
-
answer: |
102
+
### Important details about ThreadPool growth
103
+
105
104
The Common Language Runtime (CLR) ThreadPool has two types of threads, Worker and I/O Completion Port (IOCP).
106
105
107
106
- Worker threads are used for things like processing the `Task.Run(…)`, or `ThreadPool.QueueUserWorkItem(…)` methods. Various components in the CLR also use these threads when work needs to happen on a background thread.
@@ -118,12 +117,14 @@ sections:
118
117
119
118
Basically, when the number of `Busy` threads is greater than `Min` threads, you experience a 500-ms delay before the application processes the network traffic. Also, an existing thread that stays idle for longer than 15 seconds is cleaned up, and this cycle of growth and shrinkage can repeat.
120
119
121
-
Error message from StackExchange.Redis build 1.0.450 or later print ThreadPool statistics, as shown in the following example.
120
+
Error messages from StackExchange.Redis build 1.0.450 or later print ThreadPool statistics, as shown in the following example.
122
121
123
-
`System.TimeoutException: Timeout performing GET MyKey, inst: 2, mgr: Inactive,`
The example shows that for the 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.
129
130
@@ -132,7 +133,7 @@ sections:
132
133
133
134
It's best to set the minimum configuration value for `IOCP` and `WORKER` threads to something larger than the default value. There's no one-size-fits-all guidance on this value, because the right value for one application is likely too high or low for another application. This setting can also affect the performance of other parts of complicated applications. You need to fine-tune this setting to your specific needs. A good starting place is `200` or `300`. Then test and tweak as needed.
134
135
135
-
### Configure the minimum threads setting
136
+
#### Configure the minimum threads setting
136
137
137
138
You can change this setting programmatically by using the [ThreadPool.SetMinThreads (...)](/dotnet/api/system.threading.threadpool.setminthreads#System_Threading_ThreadPool_SetMinThreads_System_Int32_System_Int32_) method.
0 commit comments