AWS ElastiCache – Creating Memcached Cluster

Memcached is an open source, high-performance, distributed memory caching system intended to speed up dynamic web applications by reducing the database load. It is a key-value dictionary of strings, objects, etc., stored in the memory, resulting from database calls, API calls, or page rendering. AWS supports multiple versions of the Memcached engines to be configured for ElastiCache.

Before we start creating the cluster, we need to finalize the requirements for the cluster which will help us configure the cluster while creating it. The factors that needs to be decided for this step are as below.

  • Memory and Processor Requirements − As the cluster consist of many nodes, we need to analyse the memory and processing capability of the nodes involved. The Memcached engine is multi-threaded, so a node’s number of cores impacts the compute power available to the cluster. Also, the amount of data you have to store has to be taken into account.
  • Cluster Configuration − Memcached clusters can have 1 to 20 nodes. The data in a Memcached cluster is partitioned across the nodes in the cluster. So, In addition to the node endpoints, the Memcached cluster itself has an endpoint called the Configuration Endpoint. The endpoints of the nodes should be configured and available through the cluster endpoint.
  • Scaling Need − Amazon ElastiCache for Memcached clusters can be scaled out or in. To scale a Memcached cluster out or in you merely add or remove nodes from the cluster. When scaling up a Memcached cluster the new cluster will start out empty
  • Access Requirements − Amazon ElastiCache clusters are accessed from Amazon EC2 instances. Depending on the VPC configuration, you need to authorise proper access to the cluster from the EC2 instance using the security group configuration.

Choose Cluster Type

After your login to your Amazon account, navigate to the ElastiCache home page and choose to create ElastiCache cluster. The below screen pops-up which needs us to select the cluster engine. We choose Memcached as shown below.

Memcached Settings

Next, we choose the settings to select the Memcached engine version, Node type et. The important points in this step is to select the correct engine version and the node type which will decide the type of computing power you are utilising for the cluster and hence the cost. The port number in this step is the default value of 11211 that is assigned by the platform. The below diagram shows the inputs.

Advanced Memcached Settings

The advanced Memcached settings step asks for the details like the VPC and the subnet we are going to use for this cluster. We choose one of the existing VPC ID we have already created in the AWS account. Also we choose one of the subnets from one of the availability zones. We do not select any specific time window for maintenance and do not subscribe to SNS notification.

On clicking the create button in the above screen, the cluster creation starts. On visiting the dashboard for Memcached, we find the status of the cluster as creating.

After a while the status changes to available and the cluster’s endpoint is displayed.

Leave a Reply