{
  "id": "scale",
  "title": "Scale Redis Flex on Kubernetes",
  "url": "https://redis.io/docs/latest/operate/kubernetes/8.0.18/flex/scale/",
  "summary": "Scaling strategies and methods for Redis Flex deployments on Kubernetes.",
  "content": "\nThis guide shows you how to scale Flex databases on Kubernetes to meet changing workload demands.\n\n## Choose a scaling strategy\n\nUse the following table to determine the best scaling strategy for your Flex deployment:\n\n| Goal | Recommended action |\n|------|--------------------|\n| Increase data capacity only without adding CPU | [Increase `memorySize` and decrease RAM percentage](#decrease-ram-to-flash-ratio) |\n| Increase throughput only | [Add shards and vCPU](#add-shards-or-nodes) |\n| Increase data capacity and throughput | [Add shards](#add-shards) |\n| Improve latency under higher load | [Increase RAM percentage](#increase-ram-to-flash-ratio) |\n| Reduce cost while maintaining performance | [Tune RAM-to-flash ratio](#decrease-ram-to-flash-ratio) |\n\n## Prerequisites\n\nBefore you scale a Flex deployment, verify that your cluster has sufficient resources, such as memory, disk, and vCPU.\n\n## Scale volume\n\nIf your dataset requires more capacity while maintaining performance, you can prepare a Flex database to store more data using one of the following options:\n\n1. Increase `memorySize` and [add shards](#add-shards).\n\n1. Increase `memorySize` and [decrease the RAM-to-flash ratio](#decrease-ram-to-flash-ratio).\n\n### Add shards\n\nYou can add more shards to expand dataset capacity while maintaining the existing RAM-to-flash ratio. Throughput capacity also typically increases as a result of additional shards and infrastructure. This strategy is recommended when the dataset size and traffic are expected to grow together.\n\nBefore you increase the dataset capacity and add shards, you need to add more RAM and vCPUs to handle the increased number of shards.\n\nTo increase the dataset capacity and shards:\n\n1. Edit your REDB custom resource:\n\n    ```sh\n    kubectl edit redb \u003cdatabase-name\u003e\n    ```\n\n1. Increase `memorySize` in the `spec` section.\n\n1. Increase `shardCount` in the `spec` section.\n\n1. Save and close the file.\n\n### Decrease RAM-to-flash ratio\n\nYou can allocate more data to the flash tier to increase the database capacity while keeping the same amount of RAM, shards, and vCPU. This strategy is recommended when scaling for volume only and SSD resources are underutilized. This increases capacity without adding CPU or RAM but can lower RAM hit-rate and increase p99 latency; monitor metrics before and after the change.\n\nTo increase the dataset capacity and decrease the RAM-to-flash ratio:\n\n1. Edit your REDB custom resource:\n\n    ```sh\n    kubectl edit redb \u003cdatabase-name\u003e\n    ```\n\n1. Increase `memorySize` in the `spec` section.\n\n1. Decrease `rofRamSize` in the `redisOnFlashSpec` section.\n\n1. Save and close the file.\n\n## Scale throughput\n\nIf your workload's read/write rate increases and latency starts to rise, you can prepare the database to handle more traffic using one of the following strategies:\n\n1. [Add shards or nodes](#add-shards-or-nodes).\n\n1. [Increase the RAM-to-flash ratio](#increase-ram-to-flash-ratio).\n\n### Add shards or nodes\n\nYou can add more shards or nodes to distribute traffic and increase throughput without changing the RAM-to-flash ratio. Dataset size capacity also typically increases as a result of additional shards and infrastructure. This strategy is recommended when the dataset size and traffic are expected to grow together.\n\nBefore you add shards or nodes, you need to add more RAM and vCPUs to handle the increased number of shards or nodes. This increases capacity and potential throughput but requires more RAM, vCPUs, and a rebalance operation.\n\nTo add shards:\n\n1. Edit your REDB custom resource:\n\n    ```sh\n    kubectl edit redb \u003cdatabase-name\u003e\n    ```\n\n1. Increase `shardCount` in the `spec` section.\n\n1. Save and close the file.\n\nTo add nodes to the cluster, increase the `nodes` count in your RedisEnterpriseCluster (REC) custom resource:\n\n```sh\nkubectl edit rec \u003ccluster-name\u003e\n```\n\n### Increase RAM-to-flash ratio\n\nTo improve throughput and lower latency, you can expand the in-memory tier to serve a higher proportion of requests directly from RAM. This strategy is recommended when low latency is your primary goal and you don't need to increase the dataset size.\n\nBefore increasing the RAM-to-flash ratio, you might need to add more nodes to accommodate additional RAM. This improves throughput and lowers latency by serving more requests from RAM, at the cost of higher RAM usage.\n\nTo increase the RAM-to-flash ratio:\n\n1. Edit your REDB custom resource:\n\n    ```sh\n    kubectl edit redb \u003cdatabase-name\u003e\n    ```\n\n1. Increase `rofRamSize` in the `redisOnFlashSpec` section.\n\n1. Save and close the file.\n\n## Scale infrastructure\n\nYou can increase or adjust the underlying resources supporting the database, such as CPU, memory, and disk.\n\nFor Flex deployments on Kubernetes, ensure the cluster has sufficient physical resources before scaling. The cluster requires:\n\n- Enough RAM to support the desired in-memory dataset size.\n\n- Enough SSD capacity for flash-tier data.\n\n- Adequate vCPU to support increased shard count or throughput.\n\n\nScaling operations will fail or underperform if the underlying cluster is resource-constrained.\n\n\nPVC expansion is not supported with `redisOnFlashSpec`. Plan flash storage capacity upfront and don't enable `enablePersistentVolumeResize` in the REC `persistentSpec`.\n\nSee Flex [hardware requirements](https://redis.io/docs/latest/operate/kubernetes/flex/plan#hardware-requirements) for more information.\n",
  "tags": ["docs","operate","kubernetes"],
  "last_updated": "2026-06-04T14:49:57+01:00"
}
