Readahead & SSDs

361 views
Skip to first unread message

Stefan Wójcik

unread,
Apr 23, 2014, 3:28:17 PM4/23/14
to mongod...@googlegroups.com
Hi all,

According to http://docs.mongodb.org/manual/administration/production-notes/#recommended-configuration, it's recommended to use a readahead value of 32 (16kb). Does anyone know if this applies to SSDs as well? I recently heard a claim that it's not that useful and can actually harm the SSD's performance. However, I couldn't find a compelling explanation or a proof of that claim online.

Thanks,
Stefan

s.molinari

unread,
Apr 24, 2014, 2:42:55 AM4/24/14
to mongod...@googlegroups.com
With my admitted lack of knowledge, I'd say that claim is inaccurate. The readahead is the OSes way to speed up disk access for "unknown" usage. In other words, the readahead loads extra data from the disk, in the hope that it might be needed by the next read operation, to better serve that operation faster out of RAM and not access the disk. This is in fact good and useful, in a use case, where you have random access to the disk. In Mongo's use case with a high readahead, RAM would more likely eaten up for "preread" data, which might not even be useful for Mongo. With a lower readahead value, more of the "needed" or hot data for Mongo is actually in RAM, which means the disk usage would be better/ less for Mongo. Sounds strange and I didn't really understand it, until I read this article.


Scott  

MarkCallaghan

unread,
May 2, 2014, 7:41:08 PM5/2/14
to mongod...@googlegroups.com
Results for one simple workload on fast flash are described here. Results are less likely to be true with slower storage or with workloads that do scans.
http://smalldatum.blogspot.com/2014/05/the-impact-of-read-ahead-and-read-size.html

s.molinari

unread,
May 3, 2014, 12:28:29 AM5/3/14
to mongod...@googlegroups.com
Thanks for that Mark. Interesting the performance drop you found in 2.6.0. Great work!

Scott
Reply all
Reply to author
Forward
0 new messages