Scaling for Memcached clusters
ElastiCache for Memcached offers a fully managed, in-memory caching service that deploys, operates, and vertically scales Memcached in the Amazon cloud.
On-demand vertical scaling
With vertical scaling, ElastiCache for Memcached provides a high-performance, distributed memory caching system widely used to speed up dynamic we applications by alleviating database load. It stores data and objects in RAM, reducing the need to read from external data sources.
You can use ElastiCache for Memcached self-designed clusters for vertical scaling. You can apply vertical scaling to existing clusters as well as new ones. This can provide flexibility in resource allocation, allowing users to efficiently adapt to changing workloads without altering cluster architecture. This ability to scale improves performance by increasing cache capacity during high demand periods, and scaling down to optimize costs during low-demand periods. This simplifies operations, eliminates the need to create new clusters for shifting resource requirements, and enables quick responses to traffic fluctuations. Overall, vertical scaling for Memcached self-designed caches can help enhance cost efficiency, improve resource utilization, and even let users change their Memcached instance type. All making it easier for users to align their caching infrastructure with actual application needs.
Note
Self-designed cache and node type modifications are only available for Memcached engine versions 1.5 or later.
Auto Discovery must be enabled in order to make use of vertical scaling.
Setting up on-demand vertical scaling for ElastiCache Memcached clusters
You can configure on-demand vertical scaling for Memcached with scale-config
, which contains two parameters:
ScaleIntervalMinutes: Time (in minutes) between scaling batches during the Memcached upgrade process
ScalePercentage: Percentage of nodes to scale concurrently during the Memcached upgrade process
Converting an existing Memcached node type to a cache that can vertically scale via the CLI
To convert an existing Memcached self-designed cache to a cache that can vertically scale, you can use elasticache modify-cache-cluster
via the CLI.
aws elasticache modify-cache-cluster \ --cache-cluster-id <your-cluster-id> \ --cache-node-type <new-node-type> \ --scale-config <scale-config> \ --apply-immediately
Setting up vertical scaling with the CLI
To set up vertical scaling for your Memcached self-designed cache via the CLI, use elasticache modify-cache-cluster
with scale-config
and its parameters ScalePercentage
and ScaleIntervalMinutes
.
scale-interval-minutes:This defines the time (in minutes) between scaling batches. This setting can range from 2-30 minutes. If no value is specified, the default value of 5 minutes is applied.
scale-percentage:This specifies the percentage of nodes to scale concurrently in each batch. This setting can range from 10-100. The setting is rounded up when dividing, so for example if the result would be 49.5 a setting of 50 is applied. If no value is specified, the default value of 20 is applied.
These configuration options will enable you to fine-tune the scaling process according to your specific needs, balancing between minimizing cluster disruption and optimizing scaling speed. The scale-config parameter will only be applicable for Memcached engine types and will be ignored for other cache engines, ensuring backward compatibility with existing API usage for other clusters.
API call
aws elasticache modify-cache-cluster \ --cache-cluster-id <your-cluster-id> \ --cache-node-type <new-node-type> \ --scale-config '{ "ScalePercentage": 30, "ScaleIntervalMinutes": 2 }' --apply-immediately
Result:
Returns the cache cluster ID and the pending change.
{ "CacheCluster": { "CacheNodeType": "old_insance_type", ... ... "PendingModifiedValues": { "CacheNodeType": "new_instance_type" }, } }
List your Memcached cache vertical scaling setting
You can retrieve scaling options for your Memcached caches, and see what their current options are for vertical scaling.
API call
aws elasticache list-allowed-node-type-modifications --cache-cluster-id <your-cluster-id>
Result:
{ "ScaleUpModifications": [ "cache.x.xxxx", "cache.x.xxxx" ], "ScaleDownModifications": [ "cache.x.xxxx", "cache.x.xxxx", "cache.x.xxxx" ] }
Vertical scaling for Memcached with the Amazon Web Services Management Console
To convert an existing Memcached self-designed cache to a cache that can vertically scale through the https://console.amazonaws.cn/elasticache/
Sign in to the Amazon Web Services Management Console and open the ElastiCache console at https://console.amazonaws.cn/elasticache/
. Select the Memcached cache to convert.
Select the Modify tab.
Go to the Cache settings section, and select the desired Node type.
Select Preview changes, and review the changes.
Select Modify.