Azure Redis 缓存 - 在选择 MaxMemory-Reserved 和 MaxMemory-Policy 时需要帮助

Azure Redis Cache - Need help on choosing MaxMemory-Reserved & MaxMemory-Policy

1) 为不同的 Redis 层设置 MaxMemory-Reserved 配置的理想值是多少?有没有可以参考的recommendation/guidance?

2) 以下哪一种方法更好:

->为 Redis 缓存中的所有 Objects/Keys 实现 TTL,并将 MaxMemorey-Policy 设置为“volatile-lru”

-> 或者,不使用 TTL,只将 MaxMemory-Policy 设置为“allkeys-lru”?

-> 或者,还有其他推荐吗?

感谢对此的任何意见。

正如这位官方 document 所说 maxmemory-reserved:

The maxmemory-reserved setting configures the amount of memory in MB that is reserved for non-cache operations such as replication during failover. It can also be used when you have a high fragmentation ratio. Setting this value allows you to have a more consistent Redis server experience when your load varies. This value should be set higher for workloads which are write heavy. When memory is reserved for such operations it is unavailable for storage of cached data.

Note: The maxmemory-reserved setting is only available for Standard and Premium caches.

为了为 Maxmemory 策略 设置适当的逐出策略,您需要考虑应用程序的访问模式。正如这个 document 提到的关于 Maxmemory 策略:

Use the allkeys-lru policy when you expect a power-law distribution in the popularity of your requests, that is, you expect that a subset of elements will be accessed far more often than the rest. This is a good pick if you are unsure.

Use the volatile-ttl if you want to be able to provide hints to Redis about what are good candidate for expiration by using different TTL values when you create your cache objects.

更多细节,你可以参考这个document。此外,您可以按照此 教程 对 Azure Redis 缓存进行故障排除,并按照此 教程 在 Azure 门户中监视 Redis 缓存。