On Wed, Jul 24, 2013 at 04:47:20AM -0700, Jan Algermissen wrote:
> My question is, which kinds of disks I should choose for Redis persistence?
> Will Redis benefit from SSDs as much as other DBs do? Or would it be ok to
> opt for slower, cheaper disks?
Disk speed should rarely[1] have an impact on the interactive performance of
Redis. The only time it will even have an impact on operation is during
startup, when Redis needs to read all the data off disk and load it into
memory. If you're using a decent filesystem, and depending on what quality
of disks you're using, reading large chunks of data off disk may actually be
*faster* off spinning disk than SSD, because orbital rust is *really* good
at large-chunk sequential I/O.
Persisting data back to disk with RDB, or rewriting an AOF, is done in a
separate process, which should[2] never get in the way of serving clients.
Thus, even with the slowest disks in the world, all that'll happen is the
work takes longer to complete (and you might end up consuming more memory
than you would have otherwise).
- Matt
[1] AOF with fsync on or everysec will cause performance degradation, but if
you're comfortable with a bit of data loss you could easily go fsync no and
take the risk. Also, if you ever swap, then slower disks makes for slower
swap, but if you're swapping, you're already about up to your chest in the
performance swamp, SSDs just mean the alligators are a bit less hungry.
[2] Modulo slow forks on AWS, extra data in memory causing swapping, etc.