Setting readahead on XFS mounted file system

1,713 views
Skip to first unread message

John Wiencek

unread,
Nov 25, 2015, 3:29:11 PM11/25/15
to mongodb-user
When I start mongd on my server I get this warning message;

nitandlisten] ** WARNING: Readahead for /data/db is set to 4096KB 
2015-11-05T12:44:33.351+0000 I STORAGE [initandlisten] ** We suggest setting it to 256KB (512 sectors) or less

http://dochub.mongodb.org/core/readahead   is referenced in the log file.

We are runnning MMAPv1 storage engine..   From the mongdb webpage

For the MMAPv1 storage engine:

  • Ensure that readahead settings for the block devices that store the database files are appropriate. For random access use patterns, set low readahead values. A readahead of 32 (16kb) often works well.

    For a standard block device, you can run sudo blockdev --report to get the readahead settings and sudo blockdev --setra <value> <device> to change the readahead settings. Refer to your specific operating system manual for more information.




My /data/db mount point is an XFS mount.  

My Question:

How do a set readahead on an XFS mount point?  Do I use 

xfs_admin?   If so can someone please help with the correct syntax?   My understanding is xfs_admin is similar to tune2fs.



Stephen Steneker

unread,
Nov 25, 2015, 6:41:20 PM11/25/15
to mongodb-user

On Thursday, 26 November 2015 07:29:11 UTC+11, John Wiencek wrote:

When I start mongd on my server I get this warning message;

nitandlisten] ** WARNING: Readahead for /data/db is set to 4096KB

2015-11-05T12:44:33.351+0000 I STORAGE [initandlisten] ** We suggest setting it to 256KB (512 sectors) or less

Hi John,

As per the startup warning, your readahead is likely far too large for efficient random access (see Diagnosing high readahead).

Ensure that readahead settings for the block devices that store the database files are appropriate. For random access use patterns, set low readahead values. A readahead of 32 (16kb) often works well.

For a standard block device, you can run to get the readahead settings and sudo blockdev —setra to change the readahead settings.

How do a set readahead on an XFS mount point?

Readahead is a Linux block device setting, so the instructions at http://dochub.mongodb.org/core/readahead apply (there is no XFS-specific syntax).

If blockdev isn’t in your path, it should be in /sbin/blockdev. Note: you will need root or sudo access to run blockdev.

You can test the effect of readahead changes by restarting the mongod process after running blockdev --setra. Once you’re happy with the readahead settings, make sure to set these in a startup script so they persist after a restart.

If you need more specific suggestions, please follow up with your specific O/S version and details on your storage configuration.

Regards,
Stephen

Reply all
Reply to author
Forward
0 new messages