Azure Redis Cache - How to release memory of deleted keys?

Lodaya, Monica 1 Reputation point
2021-07-09T03:37:10.317+00:00

Questions:

  1. FLUSHALL deletes all the keys but memory used still remains same? How do I release memory used by flushed/purged/deleted keys?
  2. I have a key with memory usage of 120 bytes. How much more memory is taken by the TTL of 3600 seconds for this key?
  3. Do expired keys also not release memory? Or is it only deleted keys?
  4. Premium P1 of 6GB with 1 Shard (2 nodes primary/replica) - Does this mean we have 3GB for read/writes and 3GB is replica? Is this configurable?
Azure Cache for Redis
Azure Cache for Redis
An Azure service that provides access to a secure, dedicated Redis cache, managed by Microsoft.
251 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Anurag Sharma 17,606 Reputation points
    2021-07-09T10:38:31.233+00:00

    Hi @Lodaya, Monica , welcome to Microsoft Q&A forum.

    Please find the answers to your queries below:

    1. FLUSHALL deletes all the keys but memory used still remains same? How do I release memory used by flushed/purged/deleted keys?
      Response: FLUSHALL will delete all the keys as well as free up the memory. To check it you can go to Console on your Azure Redis Cache and issue 'INFO' command and check the Memory segment. I tried adding the 3000 keys to Azure Redis Cache and after flushing the keys it released the memory:

    Before using FLUSHALL:
    113364-image.png

    After using FLUSHALL:
    113334-image.png

    You can observe the difference here.

    1. I have a key with memory usage of 120 bytes. How much more memory is taken by the TTL of 3600 seconds for this key?
      Response: TTL will not add consume more memory, it will just add the time after which the key will be removed automatically and freeing up the memory. So in your specific case, it is still going to consume 120 bytes irrespective of TTL until key is deleted.
    2. Do expired keys also not release memory? Or is it only deleted keys?
      Response: Expired keys and delete keys both release memory. Only difference between them is Key Expiration automatically removes the keys based on timeout while in Key Deletion we manually have to delete the keys.
    3. Premium P1 of 6GB with 1 Shard (2 nodes primary/replica) - Does this mean we have 3GB for read/writes and 3GB is replica? Is this configurable?
      Response: 6 GB will belong individually to Master and replica. That means both will have 4 GB memory.

    Please let me know if this helps or else we can discuss further.

    ----------

    If answer helps, please mark it 'Accept Answer'


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.