You are not logged in.

#1 2013-05-01 21:47:07

ccc1
Member
Registered: 2009-04-16
Posts: 111

[Solved] Btrfs performance issues

Hi everybody!

I just wanted to know if somebody here also has performance issues with btrfs. I used btrfs on my ssd (samsung 840) with the compress=lzo option. When copying large files (~4Gb) a btrfs process (i think it was btrfs_alloc or similar) used 100% of one cpu core and copying was pretty slow compared to ext4. I already switched back to ext4, but still want to  know if it is a common issue ...

Edit: it also happens if compression is disabled.

ccc1

Last edited by ccc1 (2013-05-05 10:59:32)

Offline

#2 2013-05-01 22:15:55

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Btrfs performance issues

No experience with btrfs, but that doesn't really seem surprising.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#3 2013-05-01 22:37:16

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,737
Website

Re: [Solved] Btrfs performance issues

... you do realise what "compress=lzo" does, yes? Do you really expect it to do that without using your processor intensively? For small files, I imagine the CPU usage is negligible. For large files, I'd expect it to be less so.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2013-05-01 22:50:46

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: [Solved] Btrfs performance issues

WorMzy wrote:

... you do realise what "compress=lzo" does, yes? Do you really expect it to do that without using your processor intensively? For small files, I imagine the CPU usage is negligible. For large files, I'd expect it to be less so.

Good point wink.
But these files were videos, so they shouldn't get compressed and if i remember correctly performance was also degraded without using the compress option. 
Also interesting: The first GB was transfered fast, but then performance dropped significantly.

ccc1

Offline

#5 2013-05-02 00:01:34

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: [Solved] Btrfs performance issues

ccc1 wrote:

But these files were videos, so they shouldn't get compressed

Does btrfs know these things?

Also interesting: The first GB was transfered fast, but then performance dropped significantly.

Cache/buffer? Or simply misleading info from the tool you used?


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2013-05-02 00:13:04

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: [Solved] Btrfs performance issues

alphaniner wrote:
ccc1 wrote:

But these files were videos, so they shouldn't get compressed

Does btrfs know these things?

Yes, ihmo it tests if a good compression ratio can be achieved. if not it won't be compressed.

Also interesting: The first GB was transfered fast, but then performance dropped significantly.

Cache/buffer? Or simply misleading info from the tool you used?

might be. unfortunately i can't test right now, cause the i switched back to ext4

Last edited by ccc1 (2013-05-02 00:31:33)

Offline

#7 2013-05-02 01:10:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: [Solved] Btrfs performance issues

So how does it test if it can achieve a good compression ratio?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2013-05-02 01:14:11

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: [Solved] Btrfs performance issues

cfr wrote:

So how does it test if it can achieve a good compression ratio?

Since performance is also bad, when compression is disabled it doesn't matter. i guess i should edit my first post wink
it would be interesting to know if somebody else sees this cpu-spikes when copying big files.

Offline

#9 2013-05-02 02:07:46

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: [Solved] Btrfs performance issues

I have not seen these performance hits with my btrfs system.  I have only bee using it  for about a week and a half though, so maybe it will rot with time... I don't know.  I fully expect there to be increased cpu with my setup (also compress=lzo), but 100% of one core does sound a bit strange.  Overall, my system seems to not work much harder than with my olf setup of ext4 in LVM2. 

@cfr, when it copies a file to disk, if it cannot achieve a certain level of benefit from compression (I am not entirely sure what metric is used here), it somehow takes note of that and turns of compression for that one file.

Offline

#10 2013-05-02 16:44:08

donniezazen
Member
From: Salt Lake City
Registered: 2011-06-24
Posts: 671
Website

Re: [Solved] Btrfs performance issues

I copied over 350GB after clean installation of Arch Linux on a production btrfs system. There might be only a few files as big as 4GB but it took equal time to copy, without any excessive processing or performance hit, as it would on ext4. BTW I am using HDD and not SSD.

Last edited by donniezazen (2013-05-02 16:45:15)

Offline

#11 2013-05-02 18:52:07

Arogers10
Member
Registered: 2012-06-20
Posts: 68

Re: [Solved] Btrfs performance issues

I also have btrfs on an SSD and have a large movie library so I thought I would just to a quick time benchmark copying a 7GB file, mostly out of curiosity over btrfs and ext4 myself.
The CPU never did hit 100%, however gjs-console did get up to 25% a couple times. The SSD is internal btrfs and the HDD is internal ext4

HDD to SDD

time cp /run/media/aaron/beecac74-3604-4161-8802-e356d5e99931/Videos/Movies/Ghost\ Rider\ Spirit\ of\ Vengeance.mkv Desktop/

real	1m2.950s
user	0m0.083s
sys	0m8.390s

SDD to SDD

time cp Desktop/Ghost\ Rider\ Spirit\ of\ Vengeance.mkv Videos/

real	1m16.523s
user	0m0.030s
sys	0m9.580s

SDD to HDD

time cp Desktop/Ghost\ Rider\ Spirit\ of\ Vengeance.mkv /run/media/aaron/beecac74-3604-4161-8802-e356d5e99931/

real	1m7.588s
user	0m0.010s
sys	0m14.983s

HDD to HDD

time cp /run/media/aaron/beecac74-3604-4161-8802-e356d5e99931/Ghost\ Rider\ Spirit\ of\ Vengeance.mkv /run/media/aaron/beecac74-3604-4161-8802-e356d5e99931/Videos/Movies/

real	2m26.918s
user	0m0.070s
sys	0m15.647s

So these are the times I get after sending the file in a full circle. The most notable difference is the HDD took 2.5 minutes copying onto itself but it's an HDD so I expect it. Unfortunately I haven't got a second SSD with ext4 to test with, but I'd say the copy time for the btrfs isn't unreasonable. I don't have any compression on the btrfs and if it makes a difference my HDD is set to cfq while my SDD is using Deadline scheduler.

Offline

#12 2013-05-04 14:10:12

diegocg
Member
Registered: 2013-05-04
Posts: 1

Re: [Solved] Btrfs performance issues

Even when copying huge files, compression shouldn't eat a lot of CPU. Also, the compression code spreads the load to all CPUs.

Offline

#13 2013-05-05 07:57:52

ccc1
Member
Registered: 2009-04-16
Posts: 111

Re: [Solved] Btrfs performance issues

Thanks for the replies & tests!
So it seems that i'm alone with my problem wink. i think i'll give it another try and use btrfs on my ssd again and see how it goes smile

ccc1

edit: Formated my ssd with btrfs again and the problem disappeared smile

Last edited by ccc1 (2013-05-05 10:59:07)

Offline

Board footer

Powered by FluxBB