Question: What are ElastiCache network limits?


Amazon ElastiCache is a caching service provided by AWS that helps improve the performance of your applications. It supports two in-memory caching engines: Memcached and Redis. When working with ElastiCache, it's essential to understand the network limits to ensure optimal performance and avoid any bottlenecks.

ElastiCache Network Limits

  1. Maximum number of nodes per cluster:

    • Redis: Up to 15 shards (each shard can have up to 5 read replicas).
    • Memcached: Up to 20 nodes (no replication).
  2. Node bandwidth limits: The maximum bandwidth of an ElastiCache node depends on the instance type you choose. Node types with higher vCPU and memory resources tend to have higher network performance. Check the official documentation for specific bandwidth limits for each instance type.

  3. ElastiCache subnet group limits: You can have up to 50 Amazon VPC subnets in a single ElastiCache subnet group.

  4. Security groups per cache node: You are allowed to associate a maximum of 5 security groups per cache node.

To optimize your ElastiCache setup and avoid network bottlenecks, consider the following recommendations:

  • Use cluster mode enabled configuration for Redis to distribute data across multiple shards, allowing higher throughput and better resource utilization.
  • Use read replicas for read-heavy workloads to offload traffic from the primary node.
  • Monitor your ElastiCache instances using Amazon CloudWatch metrics to detect any potential issues or areas for improvement.

Here's an example of how to create a Redis cluster with cluster mode enabled using AWS CLI:

aws elasticache create-replication-group \ --replication-group-id your-replication-group-id \ --replication-group-description "Redis cluster mode enabled replication group" \ --automatic-failover-enabled \ --node-group-configuration "ReplicaCount=2,PrimaryAvailabilityZone=us-west-2a,ReplicaAvailabilityZones=us-west-2b,us-west-2c" \ --cache-node-type cache.m5.large \ --engine redis \ --engine-version 6.x \ --num-node-groups 3 \ --replicas-per-node-group 2 \ --cache-subnet-group-name your_subnet_group_name \ --security-group-ids sg-12345678 sg-23456789

Remember to replace your-replication-group-id, your_subnet_group_name, and the security group IDs with appropriate values.

Was this content helpful?

White Paper

Free System Design on AWS E-Book

Download this early release of O'Reilly's latest cloud infrastructure e-book: System Design on AWS.

Free System Design on AWS E-Book

Start building today

Dragonfly is fully compatible with the Redis ecosystem and requires no code changes to implement.