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
+24-28Lines changed: 24 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -17,39 +17,35 @@ sections:
17
17
- question: |
18
18
How can I benchmark and test the performance of my cache?
19
19
answer: |
20
-
- Use `redis-benchmark.exe` to load test your Redis server.
21
-
- Start by using `redis-benchmark.exe` to get a feel for possible throughput before writing your own performance tests.
22
-
- If you use Transport Layer Security/Secure Socket Layer (TLS/SSL) on your cache instance, add the `--tls` parameter to your `redis-benchmark` command or use a proxy like `stunnel` to enable TLS/SSL.
23
-
- `Redis-benchmark` uses port `6379` by default. Use the `-p` parameter to override this setting if your cache uses the SSL/TLS port `6380` or the Enterprise tier port `10000`.
24
-
- If necessary, you can [enable the non-TLS port through the Azure portal](cache-configure.md#access-ports) before you run the test.
25
-
- The client virtual machine (VM) you use for testing should be in the same region as your Azure Cache for Redis instance.
26
-
- Use D-series and E-series VMs for your clients for best results.
27
-
- Make sure your client VM has at least as much computing and bandwidth capability as the cache you're testing.
28
-
- Enable Virtual Receive-side Scaling (VRSS) on the client machine if you're on Windows. For more information, see [Virtual Receive-side Scaling in Windows Server 2012 R2](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn383582(v=ws.11)).
20
+
- Use `redis-benchmark.exe` to load test your Redis server. Use `redis-benchmark.exe` to get a feel for possible throughput before writing your own performance tests.
21
+
- Use `redis-cli` to monitor the cache using the `INFO` command. For instructions on downloading the Redis tools, see [How can I run Redis commands?](cache-development-faq.yml#how-can-i-run-redis-commands-)
22
+
- If you use Transport Layer Security/Secure Socket Layer (TLS/SSL) on your cache instance, add the `--tls` parameter to your Redis tools commands, or use a proxy like `stunnel` to enable TLS/SSL.
23
+
- `Redis-benchmark` uses port `6379` by default. Use the `-p` parameter to override this setting if your cache uses the SSL/TLS port `6380` or the Enterprise tier port `10000`.
24
+
- If necessary, you can [enable the non-TLS port through the Azure portal](cache-configure.md#access-ports) before you run the load test.
25
+
- Make sure the client virtual machine (VM) you use for testing is in the same region as your Azure Cache for Redis instance.
26
+
- Ensure that your client VM has at least as much computing and bandwidth capability as the cache you're testing. For best results, use D-series and E-series VMs for your clients.
27
+
- If you're on Windows, enable Virtual Receive-side Scaling (VRSS) on the client machine. For more information, see [Virtual Receive-side Scaling in Windows Server 2012 R2](/previous-versions/windows/it-pro/windows-server-2012-R2-and-2012/dn383582(v=ws.11)).
29
28
- Enable cache diagnostics so you can [monitor](../redis/monitor-cache.md) the health of your cache. You can view the metrics in the Azure portal, and you can also [download and review your metrics](https://github.com/rustd/RedisSamples/tree/master/CustomMonitoring) using the tools of your choice.
30
-
- Ensure that the load testing client and the Azure Redis cache are in the same region.
31
-
- Use `redis-cli` to monitor the cache using the `INFO` command.
32
29
- If your load is causing high memory fragmentation, scale up to a larger cache size.
33
-
- For instructions on downloading the Redis tools, see [How can I run Redis commands?](cache-development-faq.yml#how-can-i-run-redis-commands-)
34
30
35
-
Here are some examples of using `redis-benchmark.exe`. Run these commands from a VM in the same region as your cache for accurate results.
31
+
The following examples show how to use `redis-benchmark.exe`. Run these commands from a VM in the same region as your cache for accurate results.
36
32
37
-
- First, test pipelined `SET` requests using a 1k payload:
33
+
First, test pipelined `SET` requests using a 1k payload:
38
34
39
-
`redis-benchmark.exe -h <yourcache>.redis.cache.windows.net -a <yourAccesskey> -t SET -n 1000000 -d 1024 -P 50`
35
+
`redis-benchmark.exe -h <yourcache>.redis.cache.windows.net -a <yourAccesskey> -t SET -n 1000000 -d 1024 -P 50`
40
36
41
-
- After you run the `SET` test, run pipelined `GET` requests using a 1k payload:
37
+
After you run the `SET` test, run pipelined `GET` requests using a 1k payload:
42
38
43
-
`redis-benchmark.exe -h <yourcache>.redis.cache.windows.net -a <yourAccesskey> -t GET -n 1000000 -d 1024 -P 50`
39
+
`redis-benchmark.exe -h <yourcache>.redis.cache.windows.net -a <yourAccesskey> -t GET -n 1000000 -d 1024 -P 50`
44
40
45
41
- question: |
46
42
How can I enable server GC to get more throughput on the client when using StackExchange.Redis?
47
43
answer: |
48
44
Enabling server garbage collection (GC) can optimize the client and provide better performance and throughput when you use StackExchange.Redis. For more information on server GC and how to enable it, see the following articles:
49
45
50
-
- [Enable server GC](/dotnet/framework/configure-apps/file-schema/runtime/gcserver-element)
51
-
- [Fundamentals of Garbage Collection](/dotnet/standard/garbage-collection/fundamentals)
52
-
- [Garbage Collection and Performance](/dotnet/standard/garbage-collection/performance)
- [Fundamentals of garbage collection](/dotnet/standard/garbage-collection/fundamentals)
48
+
- [Garbage collection and performance](/dotnet/standard/garbage-collection/performance)
53
49
54
50
- question: |
55
51
Should I enable the non-TLS/SSL port for connecting to Redis?
@@ -67,7 +63,7 @@ sections:
67
63
- question: |
68
64
What are some considerations for using common Redis commands?
69
65
answer: |
70
-
- 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 that processes commands one at a time. Redis doesn't process commands issued after `KEYS` until it finishes processing the `KEYS` command.
66
+
- 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 that processes commands one at a time. If you issue the `KEYS` command, Redis doesn't process subsequent commands until it finishes processing the `KEYS` command.
71
67
72
68
The [redis.io](https://redis.io/commands/) site has time complexity details for each operation it supports. Select each command to see the complexity for each operation.
73
69
- What size keys to use 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 key values give better performance.
@@ -104,14 +100,14 @@ sections:
104
100
answer: |
105
101
The Common Language Runtime (CLR) ThreadPool has two types of threads, Worker and I/O Completion Port (IOCP).
106
102
107
-
- 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.
108
-
- IOCP threads are used for asynchronous I/O, such as when reading from the network.
103
+
- `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.
104
+
- `IOCP` threads are used for asynchronous I/O, such as when reading from the network.
109
105
110
106
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.
111
107
112
108
Once the number of existing busy threads hits the `minimum` threads number, the ThreadPool throttles the rate at which it injects new threads to one thread per 500 milliseconds.
113
109
114
-
Typically, if your system gets a burst of work that needs 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:
110
+
Typically, if your system gets a burst of work that needs 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:
115
111
116
112
- An existing thread becomes free to process the work.
117
113
- No existing thread becomes free for 500 ms so a new thread is created.
@@ -122,12 +118,12 @@ sections:
122
118
123
119
```output
124
120
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.
126
+
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.
131
127
132
128
> [!NOTE]
133
129
> StackExchange.Redis can hit timeouts if growth of either `IOCP` or `WORKER` threads is throttled.
0 commit comments