Welcome to the Microsoft Q&A Platform! Thank you for asking your question here.
As we understand that, you are encountering an issue with your Azure managed Redis cache where the "OOM command not allowed when used memory > 'maxmemory'" error is being triggered despite having sufficient free memory.
We would like to inform you that, the error message "OOM command not allowed when used memory > 'maxmemory'" indicates that Redis has reached its configured memory limit, and it cannot accept any more data until some memory is freed up. However, based on your description, it seems that you are not actually using the full capacity of your Azure Redis Cache instance.
Please find below the troubleshooting steps to help resolve your issue.
- Memory Fragmentation: The mem_fragmentation_ratio indicates how fragmented your memory is. A value significantly greater than 1 can suggest that memory is not being utilized efficiently. If the fragmentation is high, it might lead to situations where Redis thinks it is out of memory even though there is free memory available.
- Eviction Policy: Your current maxmemory_policy is set to noeviction, This means that Redis will not evict any keys when it reaches the memory limit, which can lead to the OOM error. You might want to consider changing this policy to one that allows eviction, such as allkeys-lru or volatile-lru, depending on your use case.
- Memory Allocation: The mem_allocator is set to jemalloc-5.3.0, which is generally efficient, but you might want to experiment with different allocators if the issue persists. Sometimes, temporary memory usage can spike due to operations like large transactions. If you are running such operations, they might temporarily increase memory usage, leading to the OOM error.
- Monitoring and Logs: Check the Azure portal for any logs or metrics that might indicate issues with your Redis instance. Azure provides monitoring tools that can help you identify memory usage patterns and potential issues.
- Azure Redis Cache Limits: Since you are using Azure Redis Cache, ensure that you are aware of any limitations or quotas that might be imposed by the Azure service.
Note: In the preview feature, there may be certain bugs or limitations that do not exist in the stable version.
If the issue still persists, please consider restarting your Azure Redis Cache instance. as this may help resolve transient issues.
Please find the below mentioned links for more information.
https://learn.microsoft.com/en-us/azure/azure-cache-for-redis/cache-best-practices-memory-management
I hope, This response will address your query and helped you to overcome on your challenges.
If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.