이 페이지에서는 확장 중에 Memorystore for Redis 클러스터 인스턴스가 어떻게 작동하는지 설명합니다.
다음과 같은 방법으로 인스턴스의 용량을 확장할 수 있습니다.
인스턴스의 샤드 수를 변경할 수 있습니다. 이를 수평 확장이라고 합니다. 다음 방법 중 하나로 인스턴스를 수평으로 확장할 수 있습니다.
수평 확장: 인스턴스의 용량을 늘려 인스턴스가 더 많은 메모리와 처리 능력을 갖춰 더 많은 데이터나 트래픽을 처리할 수 있습니다. 인스턴스의 용량은 인스턴스의 샤드 수에 따라 결정됩니다.
인스턴스를 확장하면 애플리케이션이 성능 저하 없이 증가한 수요를 처리할 수 있습니다. 인스턴스를 확장하려면 인스턴스에 샤드를 추가합니다.
스케일 인: 인스턴스의 용량을 줄여 처리 능력과 데이터를 저장하는 데 사용할 수 있는 메모리 양을 모두 줄입니다. 이는 애플리케이션의 데이터 요구사항이 감소하고 비용을 절감하기 위해 리소스 사용량을 줄여야 하는 경우에 발생합니다. 인스턴스를 축소하려면 인스턴스의 샤드 수를 줄입니다.
인스턴스의 노드 유형을 변경할 수 있습니다. 이를 수직 확장이라고 합니다.
다음 방법 중 하나로 인스턴스를 수직으로 확장할 수 있습니다.
스케일 업: 인스턴스의 용량을 늘립니다. 인스턴스의 용량은 인스턴스의 노드 유형에 따라 결정됩니다. 인스턴스를 스케일 업하려면 노드 유형을 더 큰 노드 유형으로 변경합니다. 예를 들어 redis-standard-small 노드 유형에서 redis-highmem-medium 노드 유형으로 인스턴스를 확장합니다.
축소: 인스턴스의 용량을 줄입니다. 인스턴스를 축소하려면 노드 유형을 더 작은 노드 유형으로 변경합니다. 예를 들어 인스턴스를 redis-highmem-medium 노드 유형에서 redis-standard-small 노드 유형으로 축소합니다.
확장 영향
확장 작업 중에는 인스턴스의 가용성이 영향을 받지 않습니다.
하지만 인스턴스의 샤드 수를 변경하면 Redis용 Memorystore 클러스터가 인스턴스의 키 공간을 리밸런싱합니다. 이 경우 확장 작업 중에 지연 시간이 늘어날 수 있습니다.
또한 노드 유형을 변경하여 인스턴스를 수직으로 확장하는 것은 유지보수 작업과 유사한 영향을 미칩니다.
오류 시나리오
확장 작업 중에 오류가 발생하면 다음 시나리오 중 하나가 원인일 수 있습니다.
인스턴스의 샤드 수를 업데이트하려고 하지만 인스턴스의 redis-shared-core-nano 노드 유형에 사용할 수 있는 여유 메모리가 충분하지 않습니다.
이 문제를 해결하려면 인스턴스를 확장하거나 인스턴스의 노드에서 메모리를 확보하면 됩니다. 메모리를 확보하려면 다음 단계를 따르세요.
info memory 명령어를 다시 입력합니다. 출력에서 used_memory 매개변수의 값이 더 작습니다.
used_memory 매개변수의 값을 maxmemory 매개변수의 값으로 나누고 몫이 이제 98% 미만인지 확인합니다.
그렇지 않으면 키를 더 삭제합니다.
여유 공간이 충분하지 않은 다른 노드의 경우 이 절차의 4~11단계를 반복합니다.
Memorystore for Redis Cluster가 원래 인스턴스에 저장하는 모든 키를 저장할 용량이 없는 더 작은 샤드 수로 확장했습니다. 이 문제를 해결하려면 저장된 모든 키를 보유할 수 있는 더 큰 샤드 수로 확장하세요. 인스턴스의 샤드 수를 늘리는 방법에 대한 자세한 내용은 샤드 수 확장을 참고하세요.
Memorystore for Redis 클러스터가 원래 노드 유형에 저장하는 모든 데이터를 저장할 수 없는 더 작은 노드 유형으로 확장했습니다. 이 경우 Redis용 Memorystore 클러스터는 수직으로 축소할 수 있는 권장 노드 유형을 제공합니다.
인스턴스의 노드 유형을 업데이트했으며 원래 노드 유형의 기본 설정을 덮어쓰거나 이러한 설정이 이미 덮어쓰여졌습니다. 하지만 새로운 확장 노드 유형은 기본 설정의 값을 지원하지 않거나 설정이 노드 유형에 유효하지 않습니다. 이 경우 Redis용 Memorystore 클러스터에서 오류를 반환합니다. 이 문제를 해결하려면 새 노드 유형에 유효하도록 설정을 수동으로 수정하세요.
쓰기 압력이 높은 기간 (예: 로드 테스트 중)에 인스턴스를 확장했습니다. 이 문제를 해결하려면 인스턴스 트래픽이 적은 기간에 확장하세요.
큰 키가 포함된 슬롯이 있고 이 키를 다른 노드로 이전하려고 합니다. 하지만 이 노드에는 키를 지원할 메모리가 충분하지 않습니다. 따라서 클러스터를 업데이트할 수 없습니다. 이 문제를 해결하려면 키 크기를 줄이고 업데이트 작업을 다시 시도하세요.
클러스터의 노드가 소유한 슬롯 번호는 알 수 없고 슬롯 범위만 알 수 있습니다. Memorystore for Redis 클러스터에서 오류 메시지를 반환합니다. 이 경우 키의 크기를 줄이고 업데이트 작업을 다시 시도하세요.
더 작은 샤드 수로 확장했지만 Memorystore for Redis 클러스터에 이 요청을 수용할 메모리가 충분하지 않습니다. 이 문제를 해결하려면 원래의 더 큰 샤드 수로 확장하세요.
권장사항
인스턴스의 용량을 확장하고 인스턴스 확장 속도와 안정성을 높이려면 가능할 때마다 트래픽이 적은 기간에 인스턴스를 확장하세요. 인스턴스 트래픽을 모니터링하는 방법은 클러스터 모니터링을 참고하세요.
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["이해하기 어려움","hardToUnderstand","thumb-down"],["잘못된 정보 또는 샘플 코드","incorrectInformationOrSampleCode","thumb-down"],["필요한 정보/샘플이 없음","missingTheInformationSamplesINeed","thumb-down"],["번역 문제","translationIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2025-09-04(UTC)"],[],[],null,["# About scaling instance capacity\n\nThis page describes how your Memorystore for Redis Cluster instance behaves\nduring scaling.\n\nYou can scale the capacity for your instance in the following ways:\n\n- You can change the number of shards for your instance. This is *horizontal\n scaling*. You can scale an instance horizontally in one of the following ways:\n\n - **Scale out**: increase the capacity of your instance, which gives the\n instance more memory and processing power to handle a larger volume of data or\n traffic. Your instance's capacity is determined by the number of shards in\n your instance.\n\n By scaling your instance out, your application can handle an increased\n demand without performance degradation. To scale an instance out, add\n shards to the instance.\n - **Scale in**: reduce the capacity of your instance, which decreases both the\n processing power and the amount of memory available to store data. This occurs\n when your application's data demands decrease and you need to lower your\n resource usage to save costs. To scale an instance in, reduce the number of\n shards in the instance.\n\n- You can change the node type for your instance. This is *vertical scaling*.\n You can scale an instance vertically in one of the following ways:\n\n - **Scale up** : increase the capacity of your instance. Your instance's capacity is determined by your instance's node type. To scale an instance up, change the node type to a larger node type. For example, scale your instance up from a `redis-standard-small` node type to a `redis-highmem-medium` node type.\n - **Scale down** : reduce the capacity of your instance. To scale an instance\n down, change the node type to a smaller node type. For example, scale your\n instance down from a `redis-highmem-medium` node type to a `redis-standard-small`\n node type.\n\n | **Important:** If you want to scale the node type for your instance down, and you haven't overwritten the default settings for the original node type, then Memorystore for Redis Cluster modifies the default settings to those of the scaled node type.\n\n| **Note:** For more information about the different types and sizes of shards and nodes, see [Cluster and node specification](/memorystore/docs/cluster/cluster-node-specification). To learn more about scaling a Memorystore for Redis Cluster instance, see [Scale instance capacity](/memorystore/docs/cluster/scale-instance-capacity).\n\nImpact of scaling\n-----------------\n\nDuring a scaling operation, the availability of your instance isn't impacted.\nHowever, when you change the number of shards in your instance, Memorystore for Redis Cluster rebalances the instance's keyspace. This\nmight cause increased latency during the scaling operation.\n\nAlso, the impact of scaling your instance vertically by changing the node type\nis similar to what happens with a [maintenance](/memorystore/docs/cluster/about-maintenance) operation.\n\nFailure scenarios\n-----------------\n\nIf you encounter an error during the scaling operation, then it's likely because\nof one of the following scenarios:\n\n- You want to update the shard count for your instance, but you don't have\n enough free memory for the `redis-shared-core-nano` node type for your instance.\n\n To resolve this issue, you can either [scale your instance up](/memorystore/docs/cluster/scale-instance-capacity#scale_the_node_type) or free memory from the nodes of\n your instance. To free memory, do the following:\n 1. [Connect to a Memorystore for Redis Cluster instance](/memorystore/docs/cluster/connect-cluster-instance).\n 2. To get details about the instance, including the IP address and port number, use the [`gcloud redis clusters describe`](/sdk/gcloud/reference/redis/clusters/describe) command.\n 3. Make a note of the IP address and port number of the instance.\n 4. To get information about the nodes of the instance, use the following\n command:\n\n ```\n redis-cli -h IP_ADDRESS -p PORT_NUMBER cluster nodes\n ```\n\n Replace \u003cvar translate=\"no\"\u003eIP_ADDRESS\u003c/var\u003e and \u003cvar translate=\"no\"\u003ePORT_NUMBER\u003c/var\u003e with the values that\n you noted in the previous step.\n 5. Make a note of the IP address and port number of a node that doesn't have\n enough free space. This node's ID matches an ID that appears in the error.\n\n 6. To connect to this node, use the following command:\n\n ```\n redis-cli -h IP_ADDRESS -p PORT_NUMBER\n ```\n\n Replace \u003cvar translate=\"no\"\u003eIP_ADDRESS\u003c/var\u003e and \u003cvar translate=\"no\"\u003ePORT_NUMBER\u003c/var\u003e with the values\n that you noted in the previous step.\n 7. At the prompt, enter the `info memory` command.\n\n In the output, values for the `used_memory` and `maxmemory` parameters appear. `used_memory` is how much memory the node uses and `maxmemory` is how much\n memory is available for the node.\n 8. Divide the value of the `used_memory` parameter by the value of the\n `maxmemory` parameter, and verify that the quotient is greater than 98%.\n\n 9. To free up space for the node, [delete some of the node's keys](https://redis.io/docs/latest/commands/del/).\n\n 10. Enter the `info memory` command again. In the output, the value of the\n `used_memory` parameter is smaller.\n\n 11. Divide the value of the `used_memory` parameter by the value of the\n `maxmemory` parameter, and verify that the quotient is now less than 98%.\n If it isn't, then delete more keys.\n\n 12. For any other nodes that don't have enough free space, repeat steps 4 - 11\n of this procedure.\n\n | **Caution** : We recommend that you use the `redis-shared-core-nano` node type for development or testing purposes only. If you run Memorystore for Redis Cluster in a production environment, then we recommend using the `redis-standard-small`, `redis-highmem-medium`, or `redis-highmem-xlarge` node types. For more information about these node types, see [Choose a node type](/memorystore/docs/cluster/cluster-node-specification#choose_a_node_type).\n- You scaled to a smaller shard count that doesn't have the capacity to hold\n all of the keys that Memorystore for Redis Cluster stores in the\n original instance. To resolve this, scale to a larger shard count that can\n hold all of the stored keys. For more information about increasing the number of\n shards for your instance, see [Scale the shard count](/memorystore/docs/cluster/scale-instance-capacity#scale_the_shard_count).\n\n- You scaled to a smaller node type that doesn't have the capacity to hold all\n of the data that Memorystore for Redis Cluster stores in the original\n node type. If this occurs, then Memorystore for Redis Cluster\n provides you with a recommended node type to scale down vertically.\n\n- You updated the node type for your instance and either you overwrite the default\n [settings](/memorystore/docs/cluster/supported-instance-configurations) for the\n original node type or these settings are overwritten already. However, the new,\n scaled node type either doesn't support the values for the default settings or\n the settings aren't valid for the node type. If this occurs, then Memorystore for Redis Cluster returns an error. To resolve this, modify\n the settings manually so that they're valid for the new node type.\n\n- You scaled your instance during a period of high write pressure (for example,\n during load testing). To resolve this, scale during periods of low instance\n traffic.\n\n- You have a slot which contains a large key, and you want to migrate this key\n to another node. However, this node doesn't have sufficient memory to support\n the key. As a result, you can't update your cluster. To resolve this, reduce the\n size of the key and retry the update operation.\n\n- The slot number that a node of a cluster owns isn't known, but only the slot\n range is known. Memorystore for Redis Cluster returns an error message. If this occurs,\n then reduce the size of the key and retry the update operation.\n\nBest practices\n--------------\n\nTo help you scale the capacity for your instance, and to increase the speed and\nreliability of scaling your instance, scale it during low periods of traffic,\nwhenever you can. To learn how to monitor instance traffic, see [Monitor clusters](/memorystore/docs/cluster/monitor-instances)."]]