Skip to content

Latest commit

 

History

History
32 lines (22 loc) · 1.86 KB

File metadata and controls

32 lines (22 loc) · 1.86 KB
title Best practices for memory management for Azure Managed Redis
description Learn how to manage your Azure Managed Redis memory effectively with Azure Managed Redis.
ms.date 05/18/2025
ms.topic best-practice
ms.custom
ignite-2024
build-2025
appliesto
✅ Azure Managed Redis

Memory management for Azure Managed Redis

In this article, we discuss effective memory management of an Azure Managed Redis cache.

Eviction policy

Choose an eviction policythat works for your application. The default policy for Azure Managed Redis is volatile-lru, which means that only keys that have a TTL value set with a command like EXPIRE are eligible for eviction. If no keys have a TTL value, then the system doesn't evict any keys. If you want the system to allow any key to be evicted if under memory pressure, then consider the allkeys-lru policy.

Keys expiration

Set an expiration value on your keys. An expiration removes keys proactively instead of waiting until there's memory pressure. When eviction happens because of memory pressure, it can cause more load on your server. For more information, see the documentation for the EXPIRE and EXPIREAT commands.

Monitor memory usage

Consider adding alerting on "Used Memory Percentage" metric to ensure that you don't run out of memory and have the chance to scale your cache before seeing issues. If your "Used Memory Percentage" is consistently over 75%, consider increasing your memory by scaling to a higher tier. For information on tiers, see Architecture for information on tiers.

Next steps