Azure Cache for Redis 规划常见问题解答Azure Cache for Redis planning FAQs

本文提供有关如何计划 Azure Cache for Redis 的常见问题的解答。This article provides answers to common questions about how to plan for Azure Cache for Redis.

常见问题和解答Common questions and answers

本部分包含以下常见问题解答:This section covers the following FAQs:

Azure Redis 缓存性能Azure Cache for Redis performance

下表显示了在 IaaS VM 中使用 redis-benchmark.exe 针对 Azure Redis 缓存终结点测试各种大小的标准缓存和高级缓存时,所观测到的最大带宽值。The following table shows the maximum bandwidth values observed while testing various sizes of Standard and Premium caches using redis-benchmark.exe from an IaaS VM against the Azure Cache for Redis endpoint. 对于 TLS 吞吐量,请将 redis 基准用于 stunnel 以连接到 Azure Cache for Redis 终结点。For TLS throughput, redis-benchmark is used with stunnel to connect to the Azure Cache for Redis endpoint.


这些值是没有保证的,并且我们不针对这些数字提供 SLA,但它们反映了典型的情况。These values are not guaranteed and there is no SLA for these numbers, but should be typical. 应该对自己的应用程序进行负载测试,以确定适合应用程序的缓存大小。You should load test your own application to determine the right cache size for your application. 因为我们会定期发布更新结果,这些数字可能会更改。These numbers might change as we post newer results periodically.

我们可以从此表得出以下结论:From this table, we can draw the following conclusions:

  • 在缓存大小相同的情况下,高级层中的缓存吞吐量要高于标准层中的缓存吞吐量。Throughput for the caches that are the same size is higher in the Premium tier as compared to the Standard tier. 例如,使用 6 GB 缓存,P1 的吞吐量为 180,000 请求/秒 (RPS),而 C3 的吞吐量为 100,000 RPS。For example, with a 6 GB Cache, throughput of P1 is 180,000 requests per second (RPS) as compared to 100,000 RPS for C3.
  • 启用 Redis 群集功能时,增加群集中分片(节点)的数量会导致吞吐量线性提高。With Redis clustering, throughput increases linearly as you increase the number of shards (nodes) in the cluster. 例如,若创建一个包含 10 个分片的 P4 群集,则可用吞吐量为 400,000 * 10 = 4 百万 RPS。For example, if you create a P4 cluster of 10 shards, then the available throughput is 400,000 * 10 = 4 million RPS.
  • 如果增加密钥大小,则高级层的吞吐量要高于标准层。Throughput for bigger key sizes is higher in the Premium tier as compared to the Standard Tier.
定价层Pricing tier 大小Size CPU 核心数CPU cores 可用带宽Available bandwidth 1 KB 值大小1-KB value size 1 KB 值大小1-KB value size
标准缓存大小Standard cache sizes 兆位/秒(Mb/秒)/兆字节/秒(MB/秒)Megabits per sec (Mb/s) / Megabytes per sec (MB/s) 非 SSL 请求数/秒 (RPS)Requests per second (RPS) Non-SSL SSL 请求数/秒 (RPS)Requests per second (RPS) SSL
C0C0 250 MB250 MB 共享Shared 100/12.5100 / 12.5 15,00015,000 7,5007,500
C1C1 1 GB1 GB 11 500/62.5500 / 62.5 38,00038,000 20,72020,720
C2C2 2.5 GB2.5 GB 22 500/62.5500 / 62.5 41,00041,000 37,00037,000
C3C3 6 GB6 GB 44 1000/1251000 / 125 100,000100,000 90,00090,000
C4C4 13 GB13 GB 22 500/62.5500 / 62.5 60,00060,000 55,00055,000
C5C5 26 GB26 GB 44 1,000 / 1251,000 / 125 102,000102,000 93,00093,000
C6C6 53 GB53 GB 88 2,000 / 2502,000 / 250 126,000126,000 120,000120,000
高级缓存大小Premium cache sizes 每个分片的 CPU 核心数CPU cores per shard 兆位/秒(Mb/秒)/兆字节/秒(MB/秒)Megabits per sec (Mb/s) / Megabytes per sec (MB/s) 每分片非 SSL 请求数/秒 (RPS)Requests per second (RPS) Non-SSL, per shard 每分片 SSL 请求数/秒 (RPS)Requests per second (RPS) SSL, per shard
P1P1 6 GB6 GB 22 1,500 / 187.51,500 / 187.5 180,000180,000 172,000172,000
P2P2 13 GB13 GB 44 3,000 / 3753,000 / 375 350,000350,000 341,000341,000
P3P3 26 GB26 GB 44 3,000 / 3753,000 / 375 350,000350,000 341,000341,000
P4P4 53 GB53 GB 88 6,000 / 7506,000 / 750 400,000400,000 373,000373,000
P5P5 120 GB120 GB 2020 6,000 / 7506,000 / 750 400,000400,000 373,000373,000

有关设置 stunnel 或下载 Redis 工具(例如 redis-benchmark.exe)的说明,请参阅如何运行 Redis 命令?For instructions on setting up stunnel or downloading the Redis tools such as redis-benchmark.exe, see How can I run Redis commands?.

应该将缓存放在哪个区域?In what region should I locate my cache?

为了获得最佳性能并最大程度地降低延迟,请在缓存客户端应用程序所在的区域放置 Azure Redis 缓存。For best performance and lowest latency, locate your Azure Cache for Redis in the same region as your cache client application.

我的缓存数据位于何处?Where do my cached data reside?

Azure Cache for Redis 将应用程序数据存储在托管缓存的 VM 的 RAM 中,具体取决于层级。Azure Cache for Redis stores your application data in the RAM of the VM or VMs, depending on the tier, that host your cache. 数据全部位于默认选择的 Azure 区域中。Your data reside strictly in the Azure region you've selected by default. 在两种情况下,数据可能会离开某个区域:There are two cases where your data may leave a region:

  • 在缓存上启用持久性后,Azure Cache for Redis 会将数据备份到你拥有的 Azure 存储帐户中。When you enable persistence on the cache, Azure Cache for Redis will backup your data to an Azure Storage account you own. 如果提供的存储帐户恰好位于另一个区域,则数据的副本将存储在该区域。If the storage account you provide happens to be in another region, a copy of your data will end up there.
  • 如果设置了异地复制,并且辅助缓存位于其他区域(通常是这种情况),则数据会复制到该区域。If you set up geo-replication and your secondary cache is in a different region, which would be the case normally, your data will be replicated to that region.

需要显式配置 Azure Cache for Redis 才能使用这些功能。You'll need to explicitly configure Azure Cache for Redis to use these features. 你还可以完全控制存储帐户或辅助缓存所在的区域。You also have complete control over the region that the storage account or secondary cache is located.

Azure Redis 缓存如何计费?How am I billed for Azure Cache for Redis?

Azure Redis 缓存的定价在此处Azure Cache for Redis pricing is here. 定价页列出每小时和每月费率。The pricing page lists pricing as an hourly and monthly rate. 缓存按分钟计费,从创建缓存时开始,到删除缓存时为止。Caches are billed on a per-minute basis from the time that the cache is created until the time that a cache is deleted. 没有提供用于停止或暂停缓存的计费选项。There is no option for stopping or pausing the billing of a cache.

后续步骤Next steps

了解其他 Azure Cache for Redis 常见问题解答Learn about other Azure Cache for Redis FAQs.