{
  "id": "memory-limit",
  "title": "Database memory limits",
  "url": "https://redis.io/docs/latest/operate/rs/7.8/databases/memory-performance/memory-limit/",
  "summary": "When you set a database's memory limit, you define the maximum size the database can reach.",
  "content": "When you set a database's memory limit, you define the maximum size the\ndatabase can reach in the cluster, across all database replicas and\nshards, including both primary and replica shards.\n\nIf the total size of the database in the cluster reaches the memory\nlimit, the data eviction policy is\napplied.\n\n## Factors for sizing\n\nFactors to consider when sizing your database:\n\n- **dataset size**: you want your limit to be above your dataset size to leave room for overhead.\n- **database throughput**: high throughput needs more shards, leading to a higher memory limit.\n- [**modules**](): using modules with your database consumes more memory.\n- [**database clustering**](): enables you to spread your data into shards across multiple nodes.\n- [**database replication**](): enabling replication doubles memory consumption.\n\nAdditional factors for Active-Active databases:\n\n- [**Active-Active replication**](): enabling Active-Active replication requires double the memory of regular replication, which can be up to two times (2x) the original data size per instance.\n- [**database replication backlog**]() for synchronization between shards. By default, this is set to 1% of the database size.\n- [**Active-Active replication backlog**]() for synchronization between clusters. By default, this is set to 1% of the database size.\n\n  It's also important to know Active-Active databases have a lower threshold for activating the eviction policy, because it requires propagation to all participating clusters. The eviction policy starts to evict keys when one of the Active-Active instances reaches 80% of its memory limit.\n\nAdditional factors for  databases with Auto Tiering enabled:\n\n- The available flash space must be greater than or equal to the total database size (RAM+Flash). The extra space accounts for write buffers and [write amplification](https://en.wikipedia.org/wiki/Write_amplification).\n\n- [**database persistence**](): Auto Tiering uses dual database persistence where both the primary and replica shards persist to disk. This may add some processor and network overhead, especially in cloud configurations with network attached storage.\n\n## What happens when Redis Enterprise Software is low on RAM?\n\nRedis Enterprise Software manages node memory so that data is entirely in RAM (unless using Auto Tiering). If not enough RAM is available, Redis Enterprise prevents adding more data into the databases.\n\nRedis Enterprise Software protects the existing data and prevents the database from being able to store data into the shards.\n\nYou can configure the cluster to move the data to another node, or even discard it according to the [eviction policy]() set on each database by the administrator.\n\n[Auto Tiering]()\nmanages memory so that you can also use flash memory (SSD) to store data.\n\n### Order of events for low RAM\n\n1. If there are other nodes available, your shards migrate to other nodes.\n2. If the eviction policy allows eviction, shards start to release memory,\nwhich can result in data loss.\n3. If the eviction policy does not allow eviction, you'll receive\nout of memory (OOM) messages.\n4. If shards can't free memory, Redis Enterprise relies on the OS processes to stop replicas,\nbut tries to avoid stopping primary shards.\n\nWe recommend that you have a [monitoring platform]() that alerts you before a system gets low on RAM.\nYou must maintain sufficient free memory to make sure that you have a healthy Redis Enterprise installation.\n\n## Memory metrics\n\nThe Cluster Manager UI provides metrics that can help you evaluate your memory use.\n\n- Free RAM\n- RAM fragmentation\n- Used memory\n- Memory usage\n- Memory limit\n\nSee [console metrics]() for more detailed information.\n\n## Related info\n\n- [Memory and performance]()\n- [Disk sizing for heavy write scenarios]()\n- [Turn off services to free system memory]()\n- [Eviction policy]()\n- [Shard placement policy]()\n- [Database persistence]()\n",
  "tags": ["docs","operate","rs","rc"],
  "last_updated": "2026-04-01T08:10:08-05:00"
}

