gpt4 book ai didi

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

转载 作者:可可西里 更新时间:2023-11-01 11:50:23 27 4
gpt4 key购买 nike

1) 为不同的 Redis 层设置 MaxMemory-Reserved 配置的理想值是多少?我们有什么建议/指导可以引用吗?

2) 以下哪一个是更好的方法:

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

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

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

感谢对此的任何意见。

最佳答案

作为官方document关于ma​​xmemory-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 policy:

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 .此外,您可以关注此 tutorial用于对 Azure Redis 缓存和此 tutorial 进行故障排除用于在 Azure 门户中监视 Redis 缓存。

关于redis - Azure Redis 缓存 - 在选择 MaxMemory-Reserved 和 MaxMemory-Policy 时需要帮助,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42170200/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com