Redis Memory Calculator
Calculate Redis memory usage and estimate capacity requirements. Plan for AWS ElastiCache, Azure Cache, or self-hosted Redis.
Client-side only — nothing leaves your browser
Memory Estimation
Per Key (Data)
120 B
Per Key (Overhead)
112 B
Per Key (Total)
232 B
Total Data Memory
11.44 MB
Total Overhead
10.68 MB(48.3%)
Total Memory
22.13 MB
With Fragmentation (~15%)
25.44 MB
Recommended maxmemory
31.81 MB
Understanding Redis Memory
Redis stores all data in memory for fast access. Each key has overhead for metadata, pointers, and encoding. This calculator estimates total memory including per-key overhead, which can be significant for small values.
Memory Optimization Tips
- Short keys — Use compact key names to reduce memory
- Hashes — Group small values into hashes for lower overhead
- Compression — Compress large values before storing
- Eviction — Set maxmemory-policy for automatic cleanup
Cloud Instance Reference
| Provider | Instance | Memory | Usable (~75%) |
|---|---|---|---|
| AWS ElastiCache | cache.t3.micro | 0.5 GB | ~375 MB |
| AWS ElastiCache | cache.t3.small | 1.37 GB | ~1 GB |
| AWS ElastiCache | cache.r6g.large | 13.07 GB | ~9.8 GB |
| Azure Cache | C0 (Basic) | 250 MB | ~187 MB |
| Azure Cache | C1 (Basic) | 1 GB | ~750 MB |
| Azure Cache | C3 (Standard) | 6 GB | ~4.5 GB |
Frequently Asked Questions
What is Redis maxmemory and how should I set it?
maxmemory limits Redis memory usage. Set it to 75-80% of available RAM to leave room for OS, forks (RDB/AOF), and fragmentation. When reached, Redis applies maxmemory-policy (e.g., allkeys-lru) to evict keys.
What is the difference between used_memory and used_memory_rss?
used_memory is the total bytes allocated by Redis. used_memory_rss is the actual memory from the OS perspective, including fragmentation. A high RSS-to-used ratio (>1.5) indicates fragmentation. Use MEMORY DOCTOR to diagnose memory issues.
What happens when Redis runs out of memory?
When Redis hits the maxmemory limit, its behavior depends on the configured maxmemory-policy. With noeviction (the default), Redis returns errors on write commands but continues serving reads. With policies like allkeys-lru or volatile-ttl, Redis automatically evicts keys to make room. If no maxmemory is set, Redis keeps growing until the OS kills the process via OOM killer.
How do I reduce Redis memory usage?
Use shorter key names, enable compression for large values, use hashes for small objects (hash-max-ziplist-entries), set appropriate maxmemory-policy, use Redis data structures efficiently (e.g., sets vs lists), and consider Redis modules like RedisJSON for structured data.
How much memory does a Redis hash use?
Small hashes (< hash-max-ziplist-entries, default 512) use ziplist encoding, very memory efficient. Large hashes use hashtable encoding with ~64 bytes overhead per field plus field/value sizes. For many small objects, use hashes instead of separate keys.
Need a Redis GUI Client?
1bench is a modern database client for Redis and 20+ other databases. Query, browse, and manage your data visually.
Learn More