Skip to main content

Scaling in AWS

Create an ElastiCache Redis cache

To enable proper horizontal scaling, you must create a Redis cache. AWS has its own ElastiCache Redis cache.

  1. In the AWS console, search for 'ElastiCache', and select the resulting page.
  2. Click the Get started button.
  3. Click Create Cluster, and then Create Redis Cluster.
  4. In the next screen, in the Choose a cluster creation method area, click Configure and create new cluster.
  5. In the Cluster mode field, select Disabled.
  6. Enter a name and a description for Cluster info.
  7. In the Location part, in the Location field, select AWS Cloud, and enable Multi-AZ.
  8. In the Cluster settings part, leave the Engine version, Port, and Parameter group values as they are.
  9. In the Node type field, select a size and network speed that works for your usage. You can change these values later.

To see the difference in pricing, see this page. For Numbers of replicas, we recommend two production environments.

  1. In the Subnet group settings page, create a new subnet group and provide a name, optionally a description.
  2. Select the VPC you want to use.
  3. Leave the settings in the Availability Zone placements page as they are.
  4. Click Next. It is not necessary to enable Encryption.
  5. On the Security groups tab, add a security group that will be used by Elastic Beanstalk. If you do not have an Elastic Beanstalk at this time, you can add the security group later.
  6. In the Backup tab, disable the backup. This is not necessary because the data is short-lived.
  7. In the Maintenance tab, select the settings that work for your application. We recommend enabling Auto update minor versions.
  8. Leave the other settings as they are, and click Next.
  9. In this overview screen, check if all settings are correct. If not, change them as required.
  10. Click Create.

The Redis cache is now created.

To use the newly created Redis cache, add the following section to the appsettings.json configuration file, and specify the Primary endpoint.

"RedisSettings": {
"ConnectionString": "<Primary endpoint>"

Now, you can deploy this to EC2 or Elastic Beanstalk.

Was this page helpful?