High Performance Redis looks at a wide range of techniques - from programming to system tuning - to deploy and maintain an extremely high performing Redis cluster. From the operational
perspective, the talk lays out multiple techniques for clustering (sharding) Redis systems and examines how the different
approaches impact performance time. The talk further examines system settings (Linux network parameters, Redis
system) and how they impact performance (both good and bad). Finally, for the developer, we look at how different ways of structuring data actually demonstrate different performance characteristics
4. • Software Architect with GoPro
• 10+ years building distributed systems
• 4+ years building with Redis
• Built multiple high performing Redis apps
• Previously: Apple, Netscape, Flickr
Who Am I
7. • Large number of clients
• High transaction rate
• Low response time
• Highly Available
System Features
8. Main Techniques
ü Large number of clients
ü High transaction rate
ü Low response time
ü High Availability
ü Low Response time
ü High transaction rate
ü Low response time
Clustering and Failover
System Tuning
Programming Techniques
12. • Needs a uniform work load
• Great for single key operations
• Traversals are expensive
• Node loss – roughly 1/N complete outage
• Hot keys are an issue
Trade-offs
14. • Works well for high read workload
• Replication delay
• Lose read your writes consistency
• Node loss - depends on the node
• Easy to scale up hot keys
Trade-offs
16. • High performance reads
• Significant client coding
• Consistency goes out the window
• Node loss – depends on your approach
• Double the cost
Trade-offs
17. • Clustering techniques can be combined
• Sharding + R/W Replicas
• Sharding + Multi-Node
• Multi-node is a technique of last resort
Hybrids
18. • Scale horizontally not vertically
• Use multiple Redis instances per host
• R/W replicas or dedicated shards for hot
keys
• Automate deployment and configuration
Scaling Up
19. Happily Ever After
ü Large Number of Clients
ü High Transaction Rate
q Highly Available
q Low Response Time
Let’s Party
32. Persistent
Connections
• Setup is expensive
• Reduced latency
• Server tuning maybe required
Connection Management
Operation
Pipelining
• Substantial speedup (ops/s)
• Failure harder to manage
• Client support required
Connection Pooling
• Form of persistent
connections
• Reduced latency
• Client support required
33. The structure of your Redis transactions can greatly effect the performance of your app.
Transaction Structure
Smaller
• Lower latency
• Improved responsiveness
• Reduced throughput
• Negative impact onAOF
Larger
• Higher latency
• Reduced responsiveness
• Increased throughput
• Less impact on AOF
34. Main Techniques
• Smaller Structures faster
• Pops off of long lists slow
• Internally “shard” data if possible
• replace strings with denser
coding (bit vector, map, etc)
• Moderate sized structures
• Reduce size of modifications
• Drop keys v. mutating
• Reduce impact on AOF
Structured Types
Memory Usage
Isolate Modifications
35. Happily Ever After
ü Large Number of Clients
ü High Transaction Rate
ü Highly Available
ü Low Response Time
Let’s Party