Ext4 journal options.

358 views
Skip to first unread message

Farid Sarwari

unread,
Nov 27, 2013, 12:13:34 PM11/27/13
to mongod...@googlegroups.com
It looks like "mount -o data=writeback" makes writes (updates specifically) much faster.   After looking at the man page and some online searches I found the following.   This option results in the fastest throughput because only metadata is journaled. It's not safe unless the database you are using does it's own journaling.  Postgresql and enterprisedb documentation recommend this option.   (http://www.postgresql.org/docs/9.2/static/wal-intro.html)
I couldn't find this file system mount option anywhere in the mongodb documentation.  Is it safe to use with mongodb with journaling enabled?


Thanks

Aliane Abdelouahab

unread,
Nov 27, 2013, 1:09:07 PM11/27/13
to mongod...@googlegroups.com
if you use gridfs then you will baypass ext4 limitation

2013/11/27 Farid Sarwari <farid....@gmail.com>:
> --
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb
>
> ---
> You received this message because you are subscribed to the Google Groups
> "mongodb-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mongodb-user...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Farid Sarwari

unread,
Nov 27, 2013, 3:12:58 PM11/27/13
to mongod...@googlegroups.com
Gridfs would be great for large files. But the majority of stored data are strings and numbers.  I would prefer to stick with ext4.  Does anyone use data=writeback with mongodb?  If the answer is no, then why not?

Thanks. 

Farid Sarwari

unread,
Nov 27, 2013, 3:58:27 PM11/27/13
to mongod...@googlegroups.com
XFS is listed as a supported files system for mongodb.    And it appears that XFS only does metadata journaling like ext4 with data=writeback.    This almost confirms that using this option is safe for mongodb.   Question is still why data=writeback for is not mentioned anywhere in the mongodb documentation.  Is there still some drawbacks to use ext4 in writeback mode compared to XFS?

* writeback mode
In data=writeback mode, ext4 does not journal data at all.  This mode provides
a similar level of journaling as that of XFS, JFS, and ReiserFS in its default
mode - metadata journaling.  A crash+recovery can cause incorrect data to
appear in files which were written shortly before the crash.  This mode will
typically provide the best ext4 performance.

Asya Kamsky

unread,
Nov 28, 2013, 12:10:16 AM11/28/13
to mongodb-user

It's been mentioned in blogs and on this group...   See
http://xm.x-infinity.com/2011/11/basic-ssd-tuning-for-mongodb.html?m=1

https://groups.google.com/forum/m/#!searchin/mongodb-user/data$3Dwriteback/mongodb-user/P-t8Cg_1fww

I think running some write heavy benchmarks with both settings may show whether the impact of this setting being changed would make a measurable difference...

Asya

--

Farid Sarwari

unread,
Nov 28, 2013, 7:24:13 PM11/28/13
to mongod...@googlegroups.com
Yes it does make writes faster.   I just wondering why it's not mentioned in the mongodb documentation.  They do mention other mount options like "noatime".   I just thought maybe there was reason why it wasn't mentioned.  

Thanks
fs
Reply all
Reply to author
Forward
0 new messages