Thursday, October 10, 2013

MongoDB: Readahead for /data/db/ is set to 512KB

OS: Suse Linux 11 SP2

Problem:
Wed Sep 11 08:15:55.215 [initandlisten] ** WARNING: Readahead for /data/db/ is set to 512KB
Wed Sep 11 08:15:55.215 [initandlisten] **          We suggest setting it to 256KB (512 sectors) or less
Wed Sep 11 08:15:55.215 [initandlisten] **          http://dochub.mongodb.org/core/readahead

Solution:

Login as root, and check current Readhead. First of all, find out the file system your database located in. i.e.
# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/sda2             448G  319G  107G  75% /

in my case, /dev/sda2 is the one.
#  blockdev --getra /dev/sda2

Change  Readahead
# blockdev --setra 256 /dev/sda2

restart mongodb server


$ mongo
> use admin
> db.shutdownServer({shutdown:1, force:true})

Start mongodb server again
$ mongodb

No comments:

Post a Comment