Page MenuHomeSoftware Heritage

ext4 vs. xfs object storage comparison
Closed, MigratedEdits Locked

Description

We need to compare the performance of our two implementations of sharded object storage:

  • xfs, 3-level deep, 256 wide (/srv/storage/0/00/7d/73/007d73ada118bbd80d142c126d86c1fb89e4a609)
  • ext4, 1-level deep, 16384 wide (/srv/storage/0-ext4/007d7/007d73ada118bbd80d142c126d86c1fb89e4a609)

Summary:

testxfs baselineext4improvements
read 100k random files106m10.771s73m46.195s31% better
stat 100k random files88m22.129s32m14.480s63% better

Event Timeline

100k files sample

head -100000 0-ext4 > sample.0
sed 's@^\(..\)\(..\)\(..\)@/srv/storage/0/\1/\2/\3/\1\2\3@' sample.0 > sample.0.xfs
sed 's@^\(.....\)@/srv/storage/0-ext4/\1/\1@' sample.0 > sample.0.ext4

Read all files

olasd@banco:~$ time while read f; do cat $f; done >/dev/null < sample.0.xfs 

real    106m10.771s
user    0m42.064s
sys     0m32.796s
olasd@banco:~$ time while read f; do cat $f; done >/dev/null < sample.0.ext4
   
real    73m46.195s
user    0m46.780s
sys     0m36.308s

Stat all files

olasd@banco:~$ head -200000 0-ext4 | tail -100000 > sample.1
olasd@banco:~$ wc -l sample.1
100000 sample.1
olasd@banco:~$ sed 's@^\(..\)\(..\)\(..\)@/srv/storage/0/\1/\2/\3/\1\2\3@' sample.1 > sample.1.xfs
olasd@banco:~$ sed 's@^\(.....\)@/srv/storage/0-ext4/\1/\1@' sample.1 > sample.1.ext4
olasd@banco:~$ time while read f; do stat $f; done >/dev/null < sample.1.xfs 

real    88m22.129s
user    0m45.576s
sys     0m39.192s
olasd@banco:~$ time while read f; do stat $f; done >/dev/null < sample.1.ext4

real    32m14.480s
user    0m33.428s
sys     0m36.204s
In T450#7115, @olasd wrote:

olasd@banco:~$ head -200000 0-ext4 | tail -100000 > sample.1

Just to be sure we're on the same page: this was to avoid stat()-ing the same files you've "just" read() with the previous test, right?

Aside from that, this looks promising: ~30% gain in read() (where the performance boost is likedly capped by the large files in there), ~300% gain in stat(). It's a pretty decent speed up. Although it's not earth shattering—or maybe I was expecting too much out of this.

Do you have other tests in the working?
If not, I'd like to run these numbers through Josh, to see if they match his expectations before taking a decision about what to do.

In T450#7116, @zack wrote:
In T450#7115, @olasd wrote:

olasd@banco:~$ head -200000 0-ext4 | tail -100000 > sample.1

Just to be sure we're on the same page: this was to avoid stat()-ing the same files you've "just" read() with the previous test, right?

Yeah, to try to avoid cache effects.

Aside from that, this looks promising: ~30% gain in read() (where the performance boost is likedly capped by the large files in there), ~300% gain in stat(). It's a pretty decent speed up. Although it's not earth shattering—or maybe I was expecting too much out of this.

Do you have other tests in the working?
If not, I'd like to run these numbers through Josh, to see if they match his expectations before taking a decision about what to do.

No other tests in the pipeline; I'm open to ideas :)

zack claimed this task.

This comparison is now done.
We haven't yet acted upon it, because it's unclear whether it's worth to do an in-place migration rather than, say, wait to have an additional full mirror on some cloud and rely on it for better perfs than the current XFS setup.