caching - Why redis does not use Direct IO? -


as redis large buffer, there no need kernel cache buffer redis.



why doesn't use direct io?

direct i/o poor choice following reasons:

  • for aof, need decorrelate write operation fsync operation since may not happen in same thread. cannot when use direct io.

  • for aof rewrite , rdb, stdio (buffered io) used, since lot of small objects written. don't think can use o_direct stdio (there constraints attached o_direct ...). use direct io, have write our own buffering system on top of low level api.

  • o_direct not available filesystems, , not portable.

  • sometimes buffer cache useful. instance when slave connects master, request rdb dump, , read dump. without buffer cache, operation generate twice i/o.

  • generally, dump file smaller data in memory. in many cases, not gain as think.

while o_direct not solution redis, using posix_fadvise posix_fadv_dontneed option useful in cases. in past, played simple implementation of rdb dump.


Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -