You are not logged in.

#1 2009-07-30 17:44:24

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Making XFS behave more like ext3

Yep, I'm back... Long story. I'll explain later.

Anyway, I'm using XFS, with barriers disabled for performance reasons (write performance is abominable with them enabled). But I want better data integrity... I'm not interested in completely disabling the write cache, because that would also kill performance; instead I'd like to have the buffers flushed every few seconds as ext3 does. (IIRC ext3 flushes its buffers every five seconds, which seems to work pretty well; I've never lost data with it.)

So I'm wondering, how can I change XFS' maximum write delay so it does that?

Offline

#2 2009-07-30 19:33:34

djszapi
Member
From: Cambridge, United Kingdom
Registered: 2009-06-14
Posts: 1,439
Website

Re: Making XFS behave more like ext3

"Long story" -> hehe, welcome back!

Offline

#3 2009-07-30 19:51:27

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Making XFS behave more like ext3

I have no answer to the particular question but IIRC XFS behaves like ext4(kernel>=2.6.30) which is considered safe!


English is not my native language .

Offline

#4 2009-07-30 21:26:25

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Making XFS behave more like ext3

Hmm. Something changed about how ext4 works? I thought that also had problems with the write barrier slowing things down?

Offline

#5 2009-07-31 11:41:14

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Making XFS behave more like ext3

Hmm , quote from the end of this blog post :

ext2: No robustness guarantees on system crash at all.

ext3: In the default data=ordered mode it is safe, because data is written before metadata. If you crash before the data is written (5 seconds by default) you get the old data. With data=writeback mode it is unsafe.

ext4: Currently unsafe, with a quite long window where you risk data loss. With the patches queued for 2.6.30 it is safe.

btrfs: Currently unsafe, the maintainer claims that patches are queued for 2.6.30 to make it safe

XFS: Currently unsafe (as far as i can tell), however the truncate and overwrite method is safe.

However , I recall the XFS devs mentioning many times that their FS was safe for the last year or two . The discussion usually went like this :
<Whining user/dev/blogger> Why would you break things that worked with ext3 .
<Theodore Ts'o> Performance gains . It's not just me . XFS did this long time ago & BTRFS are doing it too .
<XFS dev> Stop bringing up XFS everywhere . We fixed our sh** long time ago. We haven't had this issue for ages .

Last edited by Nezmer (2009-07-31 11:53:16)


English is not my native language .

Offline

#6 2009-08-01 05:03:35

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Making XFS behave more like ext3

instead I'd like to have the buffers flushed every few seconds as ext3 does.

simply use sysctl

I have no answer to the particular question but IIRC XFS behaves like ext4(kernel>=2.6.30) which is considered safe!

hmm.. this is the other way around: after much criticizing xfs, someone just have made ext4 copying xfs features (and still falling behind in some aspects).
this is not the first instance like this

Offline

#7 2009-08-01 09:37:56

Nezmer
Member
Registered: 2008-10-24
Posts: 559
Website

Re: Making XFS behave more like ext3

broch wrote:

instead I'd like to have the buffers flushed every few seconds as ext3 does.

simply use sysctl

I have no answer to the particular question but IIRC XFS behaves like ext4(kernel>=2.6.30) which is considered safe!

hmm.. this is the other way around: after much criticizing xfs, someone just have made ext4 copying xfs features (and still falling behind in some aspects).
this is not the first instance like this

You missed my second reply .


English is not my native language .

Offline

#8 2009-08-04 12:46:54

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Making XFS behave more like ext3

Okay, 'nother question... Is setting hdparm -W0 on my hard drive functionally the same as mounting all my filesystems with the sync options? Or do they have different effects? Which would be worse for performance?

(Right now I'm using XFS + nobarrer + "hdparm -W0 /dev/sda" in /etc/rc.local, but I'm not quite satisfied with that...)

Offline

#9 2009-08-04 23:08:50

broch
Banned
From: L.A. California
Registered: 2006-11-13
Posts: 975

Re: Making XFS behave more like ext3

hdparm -W0 /dev/sda
might improve system performance
another thing would be optimized formatting (you can further optimize xfs for small files), but I assume this is too late

Offline

#10 2009-08-20 16:33:36

RagePie
Member
From: USA
Registered: 2009-05-31
Posts: 51

Re: Making XFS behave more like ext3

http://everything2.com/title/Filesystem … S+on+Linux

This might be interesting to the OP.

EDIT: This is what I was told on the XFS mailing list today about turning off a drive's cache:

When drive write caches lose power it may lead to inconsistencies in a journaling filesystem like xfs, which relies on data hitting the disk in a certain order, more or less.  By default xfs issues barriers to enforce this ordering; this has the effect of flushing the write cache to make it safe.  In some cases disabling barriers and also disabling write cache may be a good choice.

If you "never" lose power (good ups?) then write caching is safe even w/o barriers.

Last edited by RagePie (2009-08-20 16:36:21)

Offline

#11 2009-08-26 04:58:29

Gullible Jones
Member
Registered: 2004-12-29
Posts: 4,863

Re: Making XFS behave more like ext3

Okay one more question... What do I put in sysctl to get the same effect as "hdparm -W0" for all drives? Putting "hdparm -W0 /dev/sda" in /etc/rc.local works, but it's kind of kludgy. I know that on FreeBSD you can use hw.ata.wc=0, is there an equivalent for Linux?

Offline

#12 2009-08-27 03:51:03

hunterthomson
Member
Registered: 2008-06-22
Posts: 794
Website

Re: Making XFS behave more like ext3

ZFS ... Now that is a file system to get excited about wink

Dam licensing problems mad Doesn't mesh with GNU.

But really I have nothing of use for you. I messed around with XFS and stuff but in the end I learned that when it comes to your file system what matters is... Stability, stability, stability, and vary last performance. EXT4 is to beta for me.

I got an OCZ Vertex SSD instead.

Last edited by hunterthomson (2009-08-27 03:58:51)


OpenBSD-current Thinkpad X230, i7-3520M, 16GB CL9 Kingston, Samsung 830 256GB
Contributor: linux-grsec

Offline

Board footer

Powered by FluxBB