Hacker News new | ask | show | jobs
by starspangled 517 days ago
XFS is well regarded. It is kind of a second-generation of UINX filesystem that was designed from ground up with journaling and extents and btrees and xattrs.

EXT4 is well regarded too, it has similar goodies now but it evolved from a first-generation stile without journaling and with block (not extent) tracking, primitive kinds of trees implemented as N-indirect arrays, etc. Whether that really matters is debatable, these days I think it's well acknowledged that you have to evolve and adapt to new features and clean redesigns aren't necessarily better (XFS has gone through a bunch of new changes too, e.g., metadata checksums).

XFS came from SGI IRIX and there it was really focused on datapath throughput and scalability (think, HPC systems or graphics clusters working through enormous source and result data files). And they were much less focused on metadata performance.

XFS certainly was much slower and more heavyweight than EXT doing things like creating files, but there has been a lot of work on that over many years and it's a lot better than it was. That said, a billion files is a fairly extreme corner and it's not necessarily what's required for most users.

This paper I found is similar, although probably has many differences from exactly what you were doing:

https://arxiv.org/html/2408.01805v1

XFS creation performance was around par with EXT4 up to 100M files, but took 2x as long to create 1B. Maybe yours did much worse because you aren't splitting files into subdirectories but creating them all in one? That could suggest some XFS structure has a higher order of complexity and is starting to blow out a bit, directory index for example.

XFS often comes out pretty high up there on other benchmarks

https://www.phoronix.com/review/linux-611-filesystems/3

So as always, the better performing one is going to depend on what your exact workload is, especially if you are doing something unusual.

3 comments

There's not really any reason to use ext4 over xfs anymore, unless you need fscrypt or shrinking.

Reflink support is super useful.

> Maybe yours did much worse because you aren't splitting files into subdirectories but creating them all in one?

No, and also, I'd expect that to be awful. 1000 folders, each with 1000 folders, each with 1000 files.

Those Arxiv and Phoronix links are great!

>https://www.phoronix.com/review/linux-611-filesystems/3

It's a shame that ZFS was not included.

Probably because it's benchmarking Linux filesystems.