Skip to content

Commit 6029409

Browse files
Merge pull request #272694 from flang-msft/fx---Update-link-to-download-redis-cli-(PR-#121690)
Fxl---update link to download redis cli (pr #121690)
2 parents 16d5548 + faf595e commit 6029409

File tree

2 files changed

+50
-45
lines changed

2 files changed

+50
-45
lines changed

articles/azure-cache-for-redis/cache-best-practices-development.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: Learn how to develop code for Azure Cache for Redis.
55
author: flang-msft
66
ms.service: cache
77
ms.topic: conceptual
8-
ms.date: 04/10/2023
8+
ms.date: 04/18/2024
99
ms.author: franlanglois
1010

1111
---
@@ -18,11 +18,11 @@ When developing client applications, be sure to consider the relevant best pract
1818

1919
## Consider more keys and smaller values
2020

21-
Azure Cache for Redis works best with smaller values. Consider dividing bigger chunks of data in to smaller chunks to spread the data over multiple keys. For more information on ideal value size, see this [article](https://stackoverflow.com/questions/55517224/what-is-the-ideal-value-size-range-for-redis-is-100kb-too-large/).
21+
Azure Cache for Redis works best with smaller values. To spread the data over multiple keys, consider dividing bigger chunks of data in to smaller chunks. For more information on ideal value size, see this [article](https://stackoverflow.com/questions/55517224/what-is-the-ideal-value-size-range-for-redis-is-100kb-too-large/).
2222

2323
## Large request or response size
2424

25-
A large request/response can cause timeouts. As an example, suppose your timeout value configured on your client is 1 second. Your application requests two keys (for example, 'A' and 'B') at the same time (using the same physical network connection). Most clients support request "pipelining", where both requests 'A' and 'B' are sent one after the other without waiting for their responses. The server sends the responses back in the same order. If response 'A' is large, it can eat up most of the timeout for later requests.
25+
A large request/response can cause timeouts. As an example, suppose your timeout value configured on your client is 1 second. Your application requests two keys (for example, 'A' and 'B') at the same time (using the same physical network connection). Most clients support request _pipelining_, where both requests 'A' and 'B' are sent one after the other without waiting for their responses. The server sends the responses back in the same order. If response 'A' is large, it can eat up most of the timeout for later requests.
2626

2727
In the following example, request 'A' and 'B' are sent quickly to the server. The server starts sending responses 'A' and 'B' quickly. Because of data transfer times, response 'B' must wait behind response 'A' times out even though the server responded quickly.
2828

@@ -42,9 +42,9 @@ Resolutions for large response sizes are varied but include:
4242
- Optimize your application for a large number of small values, rather than a few large values.
4343
- The preferred solution is to break up your data into related smaller values.
4444
- See the post [What is the ideal value size range for redis? Is 100 KB too large?](https://groups.google.com/forum/#!searchin/redis-db/size/redis-db/n7aa2A4DZDs/3OeEPHSQBAAJ) for details on why smaller values are recommended.
45-
- Increase the size of your VM to get higher bandwidth capabilities
46-
- More bandwidth on your client or server VM may reduce data transfer times for larger responses.
47-
- Compare your current network usage on both machines to the limits of your current VM size. More bandwidth on only the server or only on the client may not be enough.
45+
- Increase the size of your virtual machine (VM) to get higher bandwidth capabilities
46+
- More bandwidth on your client or server VM can reduce data transfer times for larger responses.
47+
- Compare your current network usage on both machines to the limits of your current VM size. More bandwidth on only the server or only on the client might not be enough.
4848
- Increase the number of connection objects your application uses.
4949
- Use a round-robin approach to make requests over different connection objects.
5050

@@ -62,19 +62,19 @@ Some Redis operations, like the [KEYS](https://redis.io/commands/keys) command,
6262

6363
## Choose an appropriate tier
6464

65-
Use Standard, Premium, Enterprise, or Enterprise Flash tiers for production systems. Don't use the Basic tier in production. The Basic tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are only meant for simple dev/test scenarios because:
65+
Use Standard, Premium, Enterprise, or Enterprise Flash tiers for production systems. Don't use the Basic tier in production. The Basic tier is a single node system with no data replication and no SLA. Also, use at least a C1 cache. C0 caches are only meant for simple dev/test scenarios because:
6666

6767
- they share a CPU core
6868
- use little memory
69-
- are prone to *noisy neighbor* issues
69+
- are prone to _noisy neighbor_ issues
7070

7171
We recommend performance testing to choose the right tier and validate connection settings. For more information, see [Performance testing](cache-best-practices-performance.md).
7272

7373
## Client in same region as cache
7474

7575
Locate your cache instance and your application in the same region. Connecting to a cache in a different region can significantly increase latency and reduce reliability.
7676

77-
While you can connect from outside of Azure, it isn't recommended *especially when using Redis as a cache*. If you're using Redis server as just a key/value store, latency may not be the primary concern.
77+
While you can connect from outside of Azure, it isn't recommended, especially when using Redis as a cache. If you're using Redis server as just a key/value store, latency might not be the primary concern.
7878

7979
## Rely on hostname not public IP address
8080

@@ -91,7 +91,7 @@ The default version of Redis that is used when creating a cache can change over
9191

9292
## Specific guidance for the Enterprise tiers
9393

94-
Because the _Enterprise_ and _Enterprise Flash_ tiers are built on Redis Enterprise rather than open-source Redis, there are some differences in development best practices. See [Best Practices for the Enterprise and Enterprise Flash tiers](cache-best-practices-enterprise-tiers.md) for more information.
94+
Because the _Enterprise_ and _Enterprise Flash_ tiers are built on Redis Enterprise rather than open-source Redis, there are some differences in development best practices. For more information, see [Best Practices for the Enterprise and Enterprise Flash tiers](cache-best-practices-enterprise-tiers.md).
9595

9696
## Use TLS encryption
9797

@@ -101,7 +101,7 @@ If your client library or tool doesn't support TLS, then enabling unencrypted co
101101

102102
### Azure TLS Certificate Change
103103

104-
Microsoft is updating Azure services to use TLS server certificates from a different set of Certificate Authorities (CAs). This change is rolled out in phases from August 13, 2020 to October 26, 2020 (estimated). Azure is making this change because [the current CA certificates don't one of the CA/Browser Forum Baseline requirements](https://bugzilla.mozilla.org/show_bug.cgi?id=1649951). The problem was reported on July 1, 2020 and applies to multiple popular Public Key Infrastructure (PKI) providers worldwide. Most TLS certificates used by Azure services today come from the *Baltimore CyberTrust Root* PKI. The Azure Cache for Redis service will continue to be chained to the Baltimore CyberTrust Root. Its TLS server certificates, however, will be issued by new Intermediate Certificate Authorities (ICAs) starting on October 12, 2020.
104+
Microsoft is updating Azure services to use TLS server certificates from a different set of Certificate Authorities (CAs). This change is rolled out in phases from August 13, 2020 to October 26, 2020 (estimated). Azure is making this change because [the current CA certificates don't one of the CA/Browser Forum Baseline requirements](https://bugzilla.mozilla.org/show_bug.cgi?id=1649951). The problem was reported on July 1, 2020 and applies to multiple popular Public Key Infrastructure (PKI) providers worldwide. Most TLS certificates used by Azure services today come from the _Baltimore CyberTrust Root_ PKI. The Azure Cache for Redis service continues to be chained to the Baltimore CyberTrust Root. Its TLS server certificates, however, will be issued by new Intermediate Certificate Authorities (ICAs) starting on October 12, 2020.
105105

106106
> [!NOTE]
107107
> This change is limited to services in public [Azure regions](https://azure.microsoft.com/global-infrastructure/geographies/). It excludes sovereign (e.g., China) or government clouds.
@@ -110,7 +110,7 @@ Microsoft is updating Azure services to use TLS server certificates from a diffe
110110
111111
#### Does this change affect me?
112112

113-
We expect that most Azure Cache for Redis customers aren't affected by the change. Your application might be affected if it explicitly specifies a list of acceptable certificates, a practice known as “certificate pinning”. If it's pinned to an intermediate or leaf certificate instead of the Baltimore CyberTrust Root, you should **take immediate actions** to change the certificate configuration.
113+
Most Azure Cache for Redis customers aren't affected by the change. Your application might be affected if it explicitly specifies a list of acceptable certificates, a practice known as _certificate pinning_. If it's pinned to an intermediate or leaf certificate instead of the Baltimore CyberTrust Root, you should take immediate actions to change the certificate configuration.
114114

115115
Azure Cache for Redis doesn't support [OCSP stapling](https://docs.redis.com/latest/rs/security/certificates/ocsp-stapling/).
116116

articles/azure-cache-for-redis/cache-development-faq.yml

Lines changed: 38 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
### YamlMime:FAQ
22
metadata:
33
title: Azure Cache for Redis development FAQs
4-
description: Learn the answers to common questions that help you develop for Azure Cache for Redis
4+
description: Learn the answers to common questions that help you develop for Azure Cache for Redis.
55
author: flang-msft
66
ms.author: franlanglois
77
ms.service: cache
88
ms.topic: faq
99
ms.devlang: csharp
1010
ms.custom: devx-track-csharp
11-
ms.date: 03/25/2022
11+
ms.date: 04/18/2024
1212
title: Azure Cache for Redis development FAQs
1313
summary: This article provides answers to common questions about how to develop for Azure Cache for Redis.
1414

@@ -43,12 +43,12 @@ sections:
4343
4444
Usually the default values of the client are sufficient. You can fine-tune the options based on your workload.
4545
46-
* **Retries**
46+
### Retries
4747
* For ConnectRetry and ConnectTimeout, the general guidance is to fail fast and retry again. This guidance is based on your workload and how much time---on average---it takes for your client to issue a Redis command and receive a response.
4848
* Let StackExchange.Redis automatically reconnect instead of checking connection status and reconnecting yourself. **Avoid using the ConnectionMultiplexer.IsConnected property**.
4949
* Snowballing - you might run into an issue where you're retrying and the retries snowball and never recover. If snowballing occurs, consider using an exponential backoff retry algorithm as described in [Retry general guidance](/azure/architecture/best-practices/transient-faults) published by the Microsoft Patterns & Practices group.
5050
51-
* **Timeout values**
51+
### Timeout values
5252
* Consider your workload and set the values to match. If you're storing large values, set the timeout to a higher value.
5353
* Set `AbortOnConnectFail` to false and let StackExchange.Redis reconnect for you.
5454
* Use a single, long-lived `ConnectionMultiplexer` instance rather than creating a new connection for each request. For an example of how to manage a connection, see the `RedisConnection`` class in [Connect to the cache with RedisConnection](cache-dotnet-how-to-use-azure-redis-cache.md#connect-to-the-cache-with-redisconnection).
@@ -59,7 +59,7 @@ sections:
5959
* You can have one multiplexer for dealing with small keys.
6060
* You can set different values for connection timeouts and retry logic for each ConnectionMultiplexer that you use.
6161
* Set the `ClientName` property on each multiplexer to help with diagnostics.
62-
* This guidance may lead to more streamlined latency per `ConnectionMultiplexer`.
62+
* This guidance might lead to more streamlined latency per `ConnectionMultiplexer`.
6363
6464
- question: |
6565
What Azure Cache for Redis clients can I use?
@@ -73,46 +73,51 @@ sections:
7373
answer: |
7474
There's no local emulator for Azure Cache for Redis. You can run the MSOpenTech version of redis-server.exe from the [Redis command-line tools](https://github.com/MSOpenTech/redis/releases/) on your local machine. Then, connect to it to get a similar experience to a local cache emulator, as shown in the following example:
7575
76-
```csharp
77-
private static Lazy<ConnectionMultiplexer>
78-
lazyConnection = new Lazy<ConnectionMultiplexer> (() =>
79-
{
80-
// Connect to a locally running instance of Redis to simulate
81-
// a local cache emulator experience.
82-
return ConnectionMultiplexer.Connect("127.0.0.1:6379");
83-
});
84-
85-
public static ConnectionMultiplexer Connection
86-
{
87-
get
88-
{
89-
return lazyConnection.Value;
90-
}
91-
}
92-
```
93-
76+
```csharp
77+
private static Lazy<ConnectionMultiplexer>
78+
lazyConnection = new Lazy<ConnectionMultiplexer> (() =>
79+
{
80+
// Connect to a locally running instance of Redis to simulate
81+
// a local cache emulator experience.
82+
return ConnectionMultiplexer.Connect("127.0.0.1:6379");
83+
});
84+
85+
public static ConnectionMultiplexer Connection
86+
{
87+
get
88+
{
89+
return lazyConnection.Value;
90+
}
91+
}
92+
```
93+
9494
You can optionally configure a [redis.conf](https://redis.io/topics/config) file to more closely match the [default cache settings](cache-configure.md#default-redis-server-configuration) for your online Azure Cache for Redis if you want.
9595
9696
- question: |
9797
How can I run Redis commands?
9898
answer: |
9999
You can use any of the commands listed at [Redis commands](https://redis.io/commands#) except for the commands listed at [Redis commands not supported in Azure Cache for Redis](cache-configure.md#redis-commands-not-supported-in-azure-cache-for-redis). You have several options to run Redis commands.
100100
101-
* If you have a Standard or Premium cache, you can run Redis commands using the [Redis Console](cache-configure.md#redis-console). The Redis console provides a secure way to run Redis commands in the Azure portal.
102-
* You can also use the Redis command-line tools. To use them, do the following steps:
103-
* Download the [Redis command-line tools](https://github.com/MSOpenTech/redis/releases/).
104-
* Connect to the cache using `redis-cli.exe`. Pass in the cache endpoint using the -h switch and the key using -a as shown in the following example:
105-
* `redis-cli -h <Azure Cache for Redis name>.redis.cache.windows.net -a <key>`
101+
If you have a Standard or Premium cache, you can run Redis commands using the [Redis Console](cache-configure.md#redis-console). The Redis console provides a secure way to run Redis commands in the Azure portal.
102+
103+
You can also use the Redis command-line tools. To use them, do the following steps:
104+
1. Download the [Redis command-line tools](/azure/azure-cache-for-redis/cache-how-to-redis-cli-tool#install-redis-cli).
105+
106+
1. Connect to the cache using `redis-cli.exe`.
107+
108+
1. Pass in the cache endpoint using the -h switch and the key using -a as shown in the following example:
109+
110+
`redis-cli -h <Azure Cache for Redis name>.redis.cache.windows.net -a <key>`
106111
107112
> [!NOTE]
108-
> The Redis command-line tools do not work with the TLS port, but you can use a utility such as `stunnel` to securely connect the tools to the TLS port by following the directions in the [How to use the Redis command-line tool with Azure Cache for Redis](./cache-how-to-redis-cli-tool.md) article.
113+
> The Redis command-line tools don't work with the TLS port, but you can use a utility such as `stunnel` to securely connect the tools to the TLS port by following the directions in the [How to use the Redis command-line tool with Azure Cache for Redis](./cache-how-to-redis-cli-tool.md) article.
109114
>
110115
>
111116
112117
- question: |
113118
Why doesn't Azure Cache for Redis have an MSDN class library reference?
114119
answer: |
115-
Microsoft Azure Cache for Redis is based on the popular open-source in-memory data store, Redis. It can be accessed by a wide variety of [Redis clients](https://redis.io/docs/connect/clients/) for many programming languages. Each client has its own API that makes calls to the Azure Cache for Redis instance using [Redis commands](https://redis.io/commands).
120+
Microsoft Azure Cache for Redis is based on the popular open-source in-memory data store, Redis. You can use a wide variety of [Redis clients](https://redis.io/docs/connect/clients/) for many programming languages. Each client has its own API that makes calls to the Azure Cache for Redis instance using [Redis commands](https://redis.io/commands).
116121
117122
Because each client is different, you can't find one centralized class reference on MSDN. Each client maintains its own reference documentation. Besides the reference documentation, there are several tutorials showing how to get started with Azure Cache for Redis using different languages and cache clients. To access these tutorials, see [How to use Azure Cache for Redis](cache-dotnet-how-to-use-azure-redis-cache.md) and it's sibling articles in the table of contents.
118123
@@ -126,7 +131,7 @@ sections:
126131
>
127132
> `session.save_path = "tcp://mycache.redis.cache.windows.net:6379?auth=<url encoded primary or secondary key here>";`
128133
>
129-
> If the key is not URL encoded, you may receive an exception with a message like: `Failed to parse session.save_path`
134+
> If the key isn't URL encoded, you might receive an exception with a message like: `Failed to parse session.save_path`
130135
>
131136
132137
For more information about using Azure Cache for Redis as a PHP session cache with the PhpRedis client, see [PHP Session handler](https://github.com/phpredis/phpredis#php-session-handler).
@@ -137,9 +142,9 @@ sections:
137142
Redis Databases are just a logical separation of data within the same Redis instance. The cache memory is shared between all the databases and actual memory consumption of a given database depends on the keys/values stored in that database. For example, a C6 cache has 53 GB of memory, and a P5 has 120 GB. You can choose to put all 53 GB / 120 GB into one database or you can split it up between multiple databases.
138143
139144
> [!NOTE]
140-
> When using a Premium Azure Cache for Redis with clustering enabled, only database 0 is available. This limitation is an intrinsic Redis limitation and is not specific to Azure Cache for Redis.
145+
> When using a Premium Azure Cache for Redis with clustering enabled, only database 0 is available. This limitation is an intrinsic Redis limitation and isn't specific to Azure Cache for Redis.
141146
142147
additionalContent: |
143148
144-
## Next steps
149+
## Related content
145150
Learn about other [Azure Cache for Redis FAQs](cache-faq.yml).

0 commit comments

Comments
 (0)