You are not logged in.

#1 2009-09-13 11:00:50

Baraclese
Member
Registered: 2008-05-28
Posts: 48

XFS vs ext4

About 3 weeks ago I set up a new home computer. For my new system I installed a minimal arch once formatted with xfs and once with ext4 to see which one would suit me better, both were mounted with defaults,noatime,nodiratime. I wanted to try btrfs but kernel 2.6.31 wasn't out yet. I did some very basic tests:

hardware specs:
wd caviar blue 640GB
phenom ii x3 720
4 GB ddr3 RAM


I downloaded a boost-1.39 tarball.
operations:
- extract the boost files,
- run bootstrap.sh which compiles the bjam executable
- use bjam to build the boost libraries

tar xzf boost.tgz
xfs:   32.296 sec
ext4:   2.421 sec

bootstrap.sh
xfs:   28.327 sec
ext4:   7.226 sec

bjam
xfs:   6m 40.120 sec
ext4:  7m 33.437 sec

final size of boost directory on disk
xfs: 466 MB
ext4: 488 MB

other observations:
ext4 is very fast when doing something like pacman -Syu while xfs will consult the disk in a much more noticable manner and take alot longer, I couldn't be bothered to time that one though.

conclusion:
ext4 is all around much nicer to work with, xfs exhibits some very annoying worst case behavior for example when creating many files. This has always annoyed me (I was a XFS user before), just checking out a large svn tree takes so much longer with that filesystem. I don't know what else bootstrap.sh does to make xfs come out so slow. In the final build step which reads from lots of small header files it comes out faster than ext4 which is good, but not good enough to convince me to go back to ext4 again.

Offline

#2 2009-09-13 11:49:43

techprophet
Member
Registered: 2008-05-13
Posts: 209

Re: XFS vs ext4

Another thing that got on my nerves with XFS is the inability to shrink the filesystem.

Offline

#3 2009-09-13 14:02:37

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: XFS vs ext4

There are some options that you can use with XFS when creating the filesystem and when mounting the filesystem that improve performance with lots of small files. Still, ext4 is way faster than XFS.

I did some benchmarks about this in my blog ( http://alpharhosigma.blogspot.com/2009/ … -ext4.html ). I won't copy it here as it's a long article.


(lambda ())

Offline

#4 2009-09-13 17:22:14

Tyriel
Member
From: Melbourne, Australia
Registered: 2009-01-20
Posts: 161
Website

Re: XFS vs ext4

Very interesting, I was curious about the performance difference of the two.  Thankyou for sharing smile


The software required Windows XP or better, so I installed archlinux.

Offline

#5 2009-09-13 21:36:54

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: XFS vs ext4

I don't care, I like xfs ;-) Thanks to xyne's rebase even pacman can be really fast with xfs. The overall system performance is great!

Last edited by Army (2009-09-13 21:37:38)

Offline

#6 2009-09-16 16:08:13

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

so how about stability...
anyone using it fulltime?
I switched to XFS from reiserfs some time ago, mainly due to XFS's incredibly fast recovery time when not cleanly unmounting. The bad side is that I forgot to add the flags to XFS during formatting that give better performance for small files. To solve that for pacman I'm using a loop file reiserfs formated filesystem.

What about bigfiles? XFS is supposed to be good at that too.

Offline

#7 2009-09-16 16:14:00

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: XFS vs ext4

In my tests, XFS is as good as ext4 with big files. With small files, ext4 is better even after optimizing XFS.


(lambda ())

Offline

#8 2009-09-16 16:20:46

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

great

and about stability? does it take long to recover from unclean unmounts?

Offline

#9 2009-09-16 18:58:15

Baraclese
Member
Registered: 2008-05-28
Posts: 48

Re: XFS vs ext4

Let's just say I haven't done an unclean unmount with ext4 yet. I can attest to XFS stability in that regard and in general though, I never had a single problem with it.

Offline

#10 2009-09-16 19:02:52

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: XFS vs ext4

XFS and ext4 are equal regarding big files.

But, XFS is horrrible with small files. XFS is for storage of ISOs, VBox HDs, system backup tarballs etc

Offline

#11 2009-09-16 21:37:10

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

anyone using ext4 as /?
I'd like to know about what I asked earlier... regarding mount times (specially when unmounting not-cleanly).

Offline

#12 2009-09-16 21:41:51

flamelab
Member
From: Athens, Hellas (Greece)
Registered: 2007-12-26
Posts: 2,160

Re: XFS vs ext4

V01D wrote:

anyone using ext4 as /?
I'd like to know about what I asked earlier... regarding mount times (specially when unmounting not-cleanly).

Ext4 as "/" reduces boot time by some seconds (in my case, 3 secs).

Offline

#13 2009-09-17 00:31:01

Aprz
Member
From: Newark
Registered: 2008-05-28
Posts: 277

Re: XFS vs ext4

Filesystems.... messy messy messy. Everytime I talk about filesystems with others, we can always establish the clear facts about it like "Oh, this one is good for small files, this one for bigs, this one for stability, this one is good for crashing, this one explodes your computer, this one melts your computer, etc...." You would think that with Math, Science, Technology, etc... Things like this would be clear facts, objective, but we always have the "What are you talking about?! This worked for me!" and "This one burnt my toast!" conversations too that revolve around filesystems. Take a look at WhyReiser4IsNotIn.

Q4. "I've been using it for years and it rocks, how can't it be ready?"

You are not a kernel programmer, are you?

Same thing with math and science, always got people using their imagination, observe something differently, tried something different, and such.

So now I think it's really best to just leave it up to each individual user on what works best for them.

I am saying this cause this thread seems like "Ext4 is better than XFS" sort of thread, and I am positive that there are people (seen this in the Gentoo forums) who will go "Have you tried doing this with XFS?!" and then you'll be like "Wow, that makes XFS hellav fast... damn!" and then Ext4 people will be like "Oh my God, that crashed my computer! I lost all my data! I must be compensated!" and these kinds of discussion just seem to go no where (other than the occasional tips, benchmark, and other useful information thrown here and there).

Anyhow... JFS is superior to all else. Don't argue with me. wink

Last edited by Aprz (2009-09-17 00:33:06)

Offline

#14 2009-09-20 16:27:02

ornitorrincos
Forum Fellow
From: Bilbao, spain
Registered: 2006-11-20
Posts: 198

Re: XFS vs ext4

funny you mentoin gentoo and JFS, the only time I tried it was installing gentoo on it, I shut down correctly the computer and on the next boot the partition was completely corrupted(and I compiled full kde)

So... as you can understand I run away from it as hard as I can. wink


-$: file /dev/zero
/dev/zero: symbolic link to '/dev/brain'

Offline

#15 2009-09-30 23:25:24

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

Hi,
I obviously don't expect that filesystem to be absolutely superior to other, I just know the things I do and don't like about XFS, so that's why I'm asking specific questions.
The last one: what about all the fuss about the delayed allocation. I'm aware there were some patches that add some preventive fsync()s to diminish the posibility of loosing data on some cases. But I've also read that XFS also does delayed allocation and I've never suffered any data loss (which I could detect at least). I'm using XFS for almost a year now (I had reiserfs for several years before) and had no problems. Mount time (even on unclean unmount) is really fast. The only downside are operations on small files. Now, when I formatted my / I forgot to enlarge the logsize, so I'm in the un-optimized case. However I've also read that ext4 seems faster in these cases even when comparing against an optimized xfs FS.
So, what about that delayed allocation? Will it be really a problem?

In any case, I'll wait to 2.6.31 since I think there are some fixes there.

Thanks

Offline

#16 2009-10-01 01:55:48

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: XFS vs ext4

I don't know if I understood your question correctly, but delayed allocation isn't correlated to optimization with small files. It's only a way to reduce writings to the disk, as it's a slow operation, and to reduce disk fragmentation.

AFAIK, Reiser3 doesn't have dellayed allocation, but it's better than XFS with small files. ext4 has dellayed allocation and it's better with small files, too.

The problem with delayed allocation is data security. The allocation is delayed, so data is kept in RAM. If a hard crash occurs, changes that have occurred but haven't been saved in disk are lost.


(lambda ())

Offline

#17 2009-10-01 02:14:09

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

Sorry, I guess I wasn't clear. The small files issue is what I intend to improve by moving to ext4 (from XFS).

Delayed allocation is (I think) the only issue that worries me when considering this migration, since I've read (as you say) it can cause data loss. The thing is that XFS is supposed to have the same mechanism, but I never encountered any problems so far (after various crashes). What I'm asking is that if this is an important issue to have in mind, or is it something I'm already facing with XFS (therefore, I shouldn't worry).

Offline

#18 2009-10-01 02:32:50

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: XFS vs ext4

The XFS developers implemented some workarounds to this delayed allocation problem. AFAIK, the ext4 developers still haven't, but they will implement it.

You can use the mount option 'nodelalloc' with ext4, and it won't use delayed allocation. It's still a pretty fast filesystem and it's, for now, more secure than ext4 without this option.

I used the 'nodelalloc' option when installing the system and configuring it, as something could go wrong, I could forget to start HAL before X, etc. Now I don't use this option anymore, as I use a notebook and power outages aren't a problem. The drawback of using this option is a higher fragmentation. I have something around 10% in my two partitions, which is quite high (and ext4 still doesn't have a defrag tool).


(lambda ())

Offline

#19 2009-10-01 02:44:47

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

Well, according to this there are some heuristics added in 2.6.30 that can fix most situations, but the problem remains. I don't know if XFS is considered more secure that ext4 in this aspect because of some specific XFS feature (maybe it flushes every 5 seconds or something).

Description of problem and announcement of patch in 2.6.30: http://www.h-online.com/open/Possible-d … ews/112821
Patch in 2.6.30: http://kernelnewbies.org/Linux_2_6_30#h … 18cdd6630d

But again, is there a difference between XFS and ext4 even after this patch?

Offline

#20 2009-10-01 02:58:09

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

Here there seems to be a mount option that ensures ext3-like behavior, which I think could be considered the safest way in comparison to xfs even, right?

http://www.h-online.com/open/Ext4-data- … ews/112892

EDIT: err, that option is not present anymore. that was from before 2.6.30. It seems that on 2.6.30 the workaround for the rename case is turned on by default, but I don't know if it could be considered more insecure than XFS in other cases or not.

Last edited by V01D (2009-10-01 03:19:37)

Offline

#21 2009-10-01 08:04:34

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: XFS vs ext4

What I can say is, when I tried ext4 on a fresh install, I forgot to start hal before X. X didn't respond to anything, of course, so I waited 10 minutes or so to give ext4 a good time to write everything to the disk and then did a hard reboot. Still, the file system was ruined, important files went down to 0kb. I NEVER had any problems with xfs, this fs is the most stable I've ever seen besides ext3. I don't really get it, because this delayed allocation thing really seems to be a real security issue, but seems like the xfs guys really did a great job on that.

Offline

#22 2009-10-01 13:39:21

V01D
Member
Registered: 2006-07-18
Posts: 128

Re: XFS vs ext4

But on which kernel version did you do the install? Before 2.6.30 that could occur, but not know I think.

Offline

#23 2009-10-01 21:17:21

Army
Member
Registered: 2007-12-07
Posts: 1,784

Re: XFS vs ext4

It was 2.6.30, just a few weeks ago

Offline

#24 2011-02-06 16:01:09

tarun.hellknight
Member
From: India
Registered: 2010-11-30
Posts: 65
Website

Re: XFS vs ext4

I managed to copy a 10.9 GB file from one internal HDD to another (both SATA II) here are the results :-

ext4 to ext4 - 1:39:187
ext4 to xfs - 1:38:494

XFS is faster by merely a second

Last edited by tarun.hellknight (2011-02-06 16:02:28)

Offline

#25 2011-02-07 02:12:58

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,356

Re: XFS vs ext4

tarun.hellknight wrote:

I managed to copy a 10.9 GB file from one internal HDD to another (both SATA II) here are the results :-

ext4 to ext4 - 1:39:187
ext4 to xfs - 1:38:494

XFS is faster by merely a second

https://wiki.archlinux.org/index.php/Fo … Bumping.27

Closing.


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB