Reputation: 3651
I'm using Redis on EC2, my question is that what would be an ideal config for a redis instance which sole purpose is just pubsub and caching?
Obviously I can turn-off the saving to disk since I'm not persisting anything but will a small disk with high memory be ideal?
Say 100k users all at once subscribed to their own pubsub channel. Will the EC2 instance following EC2 instance be enough:
High-Memory Extra Large Instance
17.1 GiB of memory
6.5 EC2 Compute Units (2 virtual cores with 3.25 EC2 Compute Units each)
420 GB of instance storage
64-bit platform
I/O Performance: Moderate
EBS-Optimized Available: No
API name: m2.xlarge
I'm having a hard time estimating since I don't know what or how to measure the memory footprint of pubsub in Redis.
Upvotes: 3
Views: 928
Reputation: 11389
pub/sub in redis is transient, and does not get persisted to disk, so, indeed, you don't need to worry about persisting redis.
The rule of thumb for estimating redis memory footprint should be based on expected number of messages per second
times average size of message
.
This is quite conservative because this assumes it takes a second to forward a message to all subscribers.
Using the above estimate, if each of your 100k users sends 1 message per second, you'd be able to accomodate messages of 150kb each.
So this should be plenty.
Upvotes: 3