Re:From 1.5 GB to 50 MB: The Story of my Redis Database
by davidcelis on Thursday March 21, 2013 @11:28AM
(#5415700)
This was one of the frustrating parts of trying to fix my issue. Every search I did for Redis optimization tips said to use hashes to reduce redundant keys (and, in doing so, use a memory efficient data structure). But every key my library uses is a SET or ZSET so, of course, hashes were off the table for me.
[ Parent
| on HN ]
Re:From 1.5 GB to 50 MB: The Story of my Redis Database
by ihsw on Thursday March 21, 2013 @02:48PM
(#5417761)
The optimization trick is outlined here:
http://redis.io/topics/memory-optimization
If your sets and zsets are bounded within a certain limit then they will be compressed and take up quite a bit less space.
Updating your configuration obviously requires a restart so that will need to be kept in mind (ie: if your data fragmentation is high then restarting will eliminate the fragmentation, so space savings will be apparent but they're not actually indicative of any changes).