Azure Cache for Redis (Used memory vs Used memory %)

Desmond Sindatry 91 Reputation points

Hello Folks,

After going over this recommendation I still have some questions. Current ACR prod cluster is at "Used Memory" of 13.2TB of 16TB and "UsedMemory %" is 45% based on the above recommendation I am not cocerned. However wanted to know the below.

  1. What happens if "Used memory" reached 100% ?
  2. Our eviction policy is "noeviction"

Thank you,

Desmond

  1. SAI JAGADEESH KUDIPUDI 3,470 Reputation points Microsoft External Staff Moderator

    Hi @Desmond Sindatry ,
    Which Redis type/tier is this (Azure Cache for Redis vs Azure Managed Redis, and the specific SKU/tier)?

    1. Is High Availability enabled (primary + replica)?
    2. Are you seeing any symptoms when usage rises (increased latency, timeouts, failovers)?
  2. Desmond Sindatry 91 Reputation points

    Its Azure Cache for Redis E400 x 4.

    Yes HA enabled

    So far we havent seen any issues.

  3. SAI JAGADEESH KUDIPUDI 3,470 Reputation points Microsoft External Staff Moderator

    Hi @Desmond Sindatry ,

    Thank you for your question.

    For Azure Cache for Redis / Azure Managed Redis, the key metric you should rely on for monitoring is Used Memory Percentage, rather than the raw Used Memory value. This is because the Used Memory metric can include memory across shards and, in High Availability configurations, it may also include both primary and replica memory. As a result, the raw memory value can appear significantly higher than the actual usable dataset size.

    In your scenario, although the cache shows 13.2 TB out of 16 TB (~82%), the Used Memory Percentage is only 45%. This indicates that the cache is not close to its effective capacity. Microsoft guidance recommends using Used Memory Percentage for scaling decisions and suggests considering scale-up only when this metric is consistently above ~75%.

    Regarding your question on what happens when memory reaches 100% with noeviction policy:

    • Redis does not evict any keys automatically when memory is full.
    • Once the configured memory limit is reached, write operations that require additional memory can fail (out-of-memory errors).
    • In addition, high memory pressure can cause paging and performance degradation, leading to increased latency and potential timeouts.

    In your case, a 45% Used Memory Percentage indicates that the cache is still operating within safe limits. You can continue monitoring without immediate scaling concerns. However, since you are using a noeviction policy, it is important to proactively monitor and scale the cache before memory approaches higher utilization levels, as Redis will not automatically free space under memory pressure.

    Microsoft Reference links

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.

  4. Desmond Sindatry 91 Reputation points

    @SAI JAGADEESH KUDIPUDI Thanks for your response. In regards to the Eviction Policy, which is currently set to noeviction based on our requirements - what happens if an eviction policy is applied to a key?

  5. SAI JAGADEESH KUDIPUDI 3,470 Reputation points Microsoft External Staff Moderator

    Hi @Desmond Sindatry ,
    Thank you for your question.

    In Redis, the behavior depends on the configured eviction policy when the cache reaches its memory limit:
    Eviction → allows writes but may evict (lose) data

    Noeviction → preserves data but blocks writes when full

    • With Eviction Policy enabled: Redis automatically removes keys based on the configured policy (LRU, TTL, random) when memory is full. This frees up space, allowing new write operations to succeed, but it may lead to data loss for the evicted keys.
    • With noeviction policy (your current setup): Redis does not remove any keys. Once the memory limit is reached, write operations fail with out-of-memory (OOM) errors. Existing data remains intact, but no new data can be written.

    Hope this helps. If you have any follow-up questions, please let me know. I would be happy to help.


Sign in to comment

1 answer

  1. AI answer

    1. When Used Memory reaches 100%

    For Azure Cache for Redis / Azure Managed Redis, high memory usage leads to memory pressure on the server. When memory pressure hits:

    • The system starts paging data to disk, which significantly slows down request processing and can cause latency and timeouts.
    • If the cache is also fragmented (for example, used_memory_rss much higher than used_memory), the platform can trigger a failover to recover Resident Set Size (RSS) memory.

    The documentation recommends:

    • Monitoring Used Memory Percentage and setting alerts so the cache can be scaled before hitting capacity.
    • Treating sustained high memory usage (for example, consistently over ~75% Used Memory Percentage) as a signal to scale to a larger tier.

    If the eviction policy is noeviction, Redis will not evict keys under memory pressure. In that case, once the cache hits its configured memory limit, write operations that require more memory will fail (for example, with out-of-memory errors), and overall performance can degrade due to paging and potential failover.

    1. Impact of noeviction with high memory usage

    With noeviction:

    • Redis never evicts keys automatically, even when memory is full.
    • The platform guidance is to manage memory proactively:
      • Set expirations on keys so data is removed before memory pressure occurs.
      • Choose an eviction policy that matches the workload if automatic eviction is acceptable (for example, volatile-lru or allkeys-lru).
      • Monitor Used Memory Percentage and scale up when it stays high.

    Given the current state (13.2 TB used, 45% Used Memory Percentage), the metrics indicate that the reported Used Memory includes both primary and replica shards on Enterprise/Enterprise Flash tiers, so the percentage metric is the primary signal for how close the cache is to its effective capacity. The recommendation is to rely on Used Memory Percentage with alerts and scale before it approaches the limit, especially when using noeviction.


    References:

    AI-generated content may be incorrect. Read our transparency notes for more information.
Sign in to answer

Your answer