You are not logged in.

#1 2010-01-15 11:39:11

alphazo
Member
Registered: 2009-10-20
Posts: 163

[Benchmark] Barriers vs no write-cache

I've experienced a pretty bad data loss on my arch install (2.6.32 with EXT4) - http://bbs.archlinux.org/viewtopic.php?id=88594

I read a bit about ext3 vs ext4 and found out few things:
- ext4 even has barriers enabled (not ext3) in order to protect the write cache operations during power loss. Unfortunately it didn't help in my case.
- default journaling is set to data=ordered for both ext3 or ext4 which is not the safest

I want to stick to EXT3/4 for the next install but I'm looking at tuning it to make it more reliable in case of power loss (freezes). I'm considering the following options for my Dell D430 and its dead slow 1.8" drive:

- ext3 with write cache enabled, data=journal and barriers=1
- ext3 with write cache disabled, data=journal and barriers= 0
- ext4: don't know if I should go for that one even if it brings some nice new features including journal checksumming.

What's your experience?

Alphazo

[EDIT] See post below for detailed benchmarks between journaling modes.

Last edited by alphazo (2010-01-16 23:08:35)

Offline

#2 2010-01-15 20:35:28

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [Benchmark] Barriers vs no write-cache

I think the wiki is wrong regarding the default journaling scheme on ext3.
http://wiki.archlinux.org/index.php/Ext … ystem_Tips
Default for most Linux distributions is data=ordered (good balance between security and performance). However I discovered on one my recent install that it has data=writeback (good for prerformance) for the root filesystem. That may explain why I lost so much data on my laptop after multiple hard resets even if it had ext4 (which normally has barriers enabled).

What does your /etc/fstab say?

Offline

#3 2010-01-15 23:13:31

tkdfighter
Member
From: Switzerland
Registered: 2009-01-28
Posts: 126

Re: [Benchmark] Barriers vs no write-cache

Offline

#4 2010-01-16 04:39:25

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [Benchmark] Barriers vs no write-cache

Thank you. I've read lots of things regarding filesystems including the links you posted. I'm just trying to figure out why my default install has used the less reliable journaling scheme (writeback) where you can read everywhere that the default for ext3 is data=ordered (including Arch Wiki).

Offline

#5 2010-01-16 08:39:23

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [Benchmark] Barriers vs no write-cache

The default for ext3 was changed to writeback a kernel version or two ago. It's a very recent change. There's a kernel option to change it back to ordered, if you compile your own kernel.
The default for ext4 is ordered. I would not recommend writeback for ext4. I had it set once and after a computer freeze, the filesystem was trashed. Completely. If I didn't make regular backups...

Offline

#6 2010-01-16 08:46:42

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [Benchmark] Barriers vs no write-cache

Thank you that is very good information. So that is not the explanation for the complete data loss on my ext4 installation after multiple hard resets. BTW, I believe that barriers are still disabled by default for ext3 but enabled for ext4.

Offline

#7 2010-01-16 20:43:17

alphazo
Member
Registered: 2009-10-20
Posts: 163

Re: [Benchmark] Barriers vs no write-cache

I benchmarked the different options (ext3/ext4, journaling modes, write cache, barrier) with some basic tools and posted the results here:

https://natzo.com/doku.php?id=categorie … filesystem

ext4 with data=ordered, write cache and barriers enable gives some good results and provides a good security. Switching to full journal slows thing significantly  whereas full journal and write cache disabled has a big impact. Reading through some articles shows that data=ordered is still better than metadata only (writeback) so while it doesn't prevent from data corruption it should reduce the risk.

I need to run the same benchmark on my laptop and its ridiculous 1.8" ultra slow hardware to see if the ranking changes.

Alphazo

Offline

Board footer

Powered by FluxBB