Write Speed Degradation from 13.1 to 13.2 XFS Versions

Based on a comment in another thread about XFS changes, sometime after doing a fresh
install of 13.2, I reformatted my existing XFS partitions that had been created with 13.1.
The copy performance degraded after the reformat. Here are the details:

I have an internal 430 GB raid (md2) partition on sata drives that was formatted XFS using 13.1.
I store several VirtualBox virtual machines on that partition.

I have an external USB3 3TB partition (sdc1) that was formatted XFS using 13.1.

Under BOTH 13.1 and 13.2, when using drag-and-drop between two Dolphin windows to copy
the files from the internal drive to the external USB3 drive, Dolphin would report a write speed
of around 105 MiB/s. After reformatting both partitions under 13.2, Dolphin now reports
a write speed of around 70 MiB/s.

In other words, using both 13.1 and 13.2 Dolphin, I got a write speed of 105 MiB/s from md2 to sdc1
XFS partitions that were formatted under 13.1, but when the partitions were reformatted under 13.2 the
write speed dropped to 70 MiB/s

Any ideas what caused the speed drop and how to reverse it?

I guess I could boot a 13.1 DVD and reformat the XFS partitions using the 13.1 XFS,
but I’d really like to understand what happened.

I never determined why there was a 33% degradation in write
performance on OS 13.2 XFS (70 MiB/s) as compared to
OS 13.1 XFS (105 MiB/s).

I finally resolved the issue by converting all of
my XFS partitions to BTRFS partitions. Those were
md1 (400 GiB mounted at /home), md2 (430 GiB mounted at /data1),
sdc1 (3TB USB3 drive mounted at /run/media/<userid>

Now copying the large virtual machines from md2 to sdc1
typically runs at between 115 MiB/s and 125 MiB/s.

On 2014-12-04 17:46, xlis wrote:

> but I’d really like to understand what happened.

You could ask the folks at the xfs mail list (xfs at oss.sgi.com)

As a wild guess, when using raid and xfs, there are certain alignment
issues that you have to take care of. I thought that YaST did it
automatically, I don’t really know how to do it manually.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Alignment would be the first thing to look at.

MBR disks often align partitions to begin at as sector that is a multiple of 63. This often gets carried over, depending on how you did your partitioning.

The new disks, and new filesystems, use 4KiB or larger data structures.

Make certain you align your partitions to sectors that are multiples of 4KiB. You could, like Microsoft does with Vista and later, align partitions to 1MiB boundaries. You will lose some space at the beginning of the drive (depending on what else you are doing, it could be almost a Meg lost at the front), but this is almost nothing on modern disks. Beyond that, you are unlikely to waste any space between partitions by aligning to 1-MiB boundaries.

I have seen benchmark tests that show a huge loss in disk reads and writes by not aligning at least to the 4KiB, even some cases where a write that takes 1 second on an aligned drive can actually take up to 25 seconds or more on the same drive when not aligned.

You can do this with a good partitioner that gives you the alignment options, such as Yast’s partitioner (choose Custom Region and choose your start cylindar) or Partition Magic or GParted, among a few others.

Fraser_Bell,

Thanks for the input.

The partitions were created back when I was running 12.3.
Their sizes and locations have not been modified since.
They were XFS formatted (from EXT4) when I installed 13.1.
All start boundaries are on 1Gib locations; each disk in the md2 array
has a 2GiB partition at the beginning (one for /boot, and one for swap).
The sdc1 USB3 disk was a single 3TB partition formatted XFS.

Under BOTH 13.1 AND 13.2 the write speed from md2 to sdc1 was approx 105MiB.
The ONLY change was reformatting md2 and sdc1 (still XFS) about a week
after installing 13.2. After that reformat the write speed dropped to 70MiB.

I’ve now reformatted those same partitions with BTRFS, and the write
speed from md2 to sdc1 runs about 120MiB/s typical.

I don’t know what changed in XFS between the 13.1 release and the 13.2
release, but it takes considerable time to backup/restore the data on those
partitions. Now that BTRFS is providing me better performance than I
got with either version of XFS, I’m going to leave the partitions as BTRFS.

The 12.3 Installer was used to create the partitions and raid arrays initially.
All were originally formatted EXT4 in 12.3.

md0 was reformatted (still EXT4) during the installation of 13.1
md1, md2, and sdc1 were reformatted to XFS during the installation of 13.1.

md0 was reformatted to BTRFS during the installation of 13.2.
md1, md2, and sdc1 were NOT reformatted during the installation of 13.2 (stayed XFS).

Any reformatting in 13.1 or 13.2 was always done via the YaST Partitioner.

The raid10 disks (sda, sdb) are laid out like this:


sda1 2Gib for /boot
sda2 100GiB for md0
sda3 400Gib for md1
sda4  429.51 GiB for md2

sdb1 2Gib for swap
sdb2 100GiB for md0
sdb3 400Gib for md1
sdb4  429.51 GiB for md2

md0 (sda2, sdb2) is root BTRFS
md1 (sda3, sdb3) is /home BTRFS (was XFS)
md2 (sda4, sdb4) is /data1 BTRFS (was XFS)

sdc1 USB3 3TB (2.73TiB) BTRFS (was XFS)

Your partition layout looks good. And, since you did not reformat the XFS partitions, it is unlikely sector size within would be a factor, though there is a very slight possibility of that if certain changes have taken place in the system.

So, who knows?

I do know that, with changes on a complex system (perhaps OS, perhaps drivers, perhaps hardware changes, and so forth), performance in the various file-systems can flip back and forth, which is why it is difficult to recommend the best-performing file system to anyone. That is something that has to be tested on a trial-and-error basis.

In your case, it seems Btrfs is your ticket.:wink:

On 2014-12-09 00:46, Fraser Bell wrote:
>
> Your partition layout looks good. And, since you did not reformat the
> XFS partitions,

No, I understand he did, on the partition that shows degradation. And it
is on top of a software raid.

XFS has changed in 13.2, it is in fact not readable by 13.1.

And the XFS people warn that when using raid, the sectors (no, that’s
not the right name) in the raid have to be aligned with the sectors on
the xfs partition. No, I don’t really know how to do this.

> In your case, it seems Btrfs is your ticket.:wink:

If it works, perfect :slight_smile:


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Do you mean stripe alignment?
http://xfs.org/docs/xfsdocs-xml-dev/XFS_User_Guide/tmp/en-US/html/ch04s04.html

On 2014-12-09 07:26, arvidjaar wrote:
>
> robin_listas;2681678 Wrote:
>>
>> And the XFS people warn that when using raid, the sectors (no, that’s
>> not the right name) in the raid have to be aligned with the sectors on
>> the xfs partition.
>
> Do you mean stripe alignment?

It rings a bell, yes.

> http://tinyurl.com/nj4vw8h

Yes, this is what I meant. I’ve never needed to do it manually.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)