xfs
[Top] [All Lists]

Online TRIM/discard performance impact

To: xfs@xxxxxxxxxxx
Subject: Online TRIM/discard performance impact
From: Martin Rusko <martin.rusko@xxxxxxxxx>
Date: Sat, 5 Nov 2011 21:07:05 +0100
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ieid+w2eNB+Cx9kZtenzGSXg7hZ66WnKZgdEl4Ddhhs=; b=LXSWrAK2fszL3JtlEWWIefg3lcd0Nn9sdl93MGCl1241X1wjQdcN0HK7CzhgDlkMqm sKOkCIsO4keLbK7l2UwJLrVMjzKVbifX6qbsKAf5ik8ZX9DaE3ss4MGxT6kFNBIiMWAE 5ADa3cM6B7xwYF3tyM9U4Cy8th8kfFfJt+2lE=
Hello,

I wanted to ask if following performance drop with online discard
enabled for XFS is normal. I went through mailing list archives and
read information from Lukáš's page
(http://people.redhat.com/lczerner/discard/) so I was prepared for
some performance penalty. But this big?

--> Filesystem is mounted with noatime and discard options ...

/dev/sdb2 on /mnt/test-xfs type xfs (rw,noatime,discard)

--> Deleting freshly unpacked linux kernel sources ...

# time rm -rf linux-3.0.8

real    4m50.155s
user    0m0.012s
sys     0m0.940s

==> It took almost 5 minutes!

--> Deleting same freshly unpacked linux kernel sources this time with
filesystem mounted without 'discard' option ...

/dev/sdb2 on /mnt/test-xfs type xfs (rw,noatime)

# time rm -rf linux-3.0.8

real    0m1.023s
user    0m0.024s
sys     0m0.896s

==> It took a second and something.

SSD drive in question is one of the latest with SF-2281 chipset. I
expected, that TRIM function will just schedule sectors for garbage
collection, which happens some time later (during which drive can be
potentially slower). Trying the same tests with ext4 filesystem, it
got following numbers.

--> ext4 with 'discard' option ...

/dev/sdb3 on /mnt/test-ext4 type ext4 (rw,noatime,discard)

# time rm -rf linux-3.0.8

real    0m0.486s
user    0m0.012s
sys     0m0.468s

--> ext4 without 'discard' option ...

/dev/sdb3 on /mnt/test-ext4 type ext4 (rw,noatime)

root@layla:/mnt/test-ext4# time rm -rf linux-3.0.8

real    0m0.483s
user    0m0.020s
sys     0m0.460s

Tests were repeated several times and it was consistent. Deleting
files on XFS filesystem mounted with 'discard' option was painfully
slow. Kernel version was ...

   Linux layla 3.0.0-12-generic #20-Ubuntu SMP Fri Oct 7 14:56:25 UTC
2011 x86_64 x86_64 x86_64 GNU/Linux

Is this expected behavior?

Best Regards,
Martin

<Prev in Thread] Current Thread [Next in Thread>