Why keys are evicted before the expiration period?

Last updated 18, Apr 2024

Question

Why keys are evicted before the expiration period?

Answer

The database has hit its configured memory limit of GB, and the eviction policy is configured for volatile-lru. Since some keys are being evicted before their TTL expires, this may account for the missing ones before expiration. It is possible to increase the memory limit by logging into the cluster UI and following these steps:

  1. Go to Database and select the database you want to edit.
  2. Go to Configuration and click Edit at the bottom of the page. The database settings appear.
  3. Change the "Memory limit (GB)" value to the desired size and click Update.

Since replication is enabled, the data in the replica shards also uses the memory in this configured limit. Here is the link to the relevant document.