btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for SSD?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.

Which filesystem do you recommend for SSD?

ext4
6
55%
btrfs
3
27%
f2fs
0
No votes
xfs
2
18%
zfs
0
No votes
other
0
No votes
 
Total votes: 11

damian101
Level 1
Level 1
Posts: 3
Joined: Mon Jan 04, 2021 4:44 pm

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by damian101 »

I have the exact same behavior on my Arch Linux installation, and thanks to your last comment @ilwegesk I figured out that it isn't only the hourly snapshot deletion, but also the hourly snapshot creation that causes the issues for me. Creating or deleting a Btrfs system snapshot can take about 2 minutes on my system. The filesystem is on an SSD. No idea why it takes that long.

Edit: I disabled Btrfs qgroups in the Timeshift settings, and now creating or deleting a Btrfs system snapshot takes almost no time.

Edit 2: While manual snapshot creation and deletion through Timeshift happens instantly now, automatic snapshot creation and deletion seems to take just as long as before, more than 3 minutes combined, locking my filesystem during that period.
Last edited by damian101 on Wed Mar 31, 2021 12:10 pm, edited 1 time in total.
User avatar
vonMos
Level 1
Level 1
Posts: 39
Joined: Sat Mar 21, 2015 8:19 am
Location: Romania

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by vonMos »

ilwegesk wrote: Sun Dec 13, 2020 3:36 pm Hi there!

I installed mint on a btrfs partition about six month ago. Every now and then, some processes hang for 1 to 5 minutes and then they all resume simultaneously. That's a bit annoying ... Not all processes do hang, though. My assumption is that processes that do disk IO hang, e.g. when I want to start glances or htop or journalctl, the terminal hangs until everything is fine again.

Recently (I had by chance glances running), I noticed that when this happens the btrfs-transaction process has very high CPU (around 100%).
As soon as this process terminates, all hanging processes resume instantly.
Even though btrfs-cleaner is running afterwards, also with very high CPU (still around 95%).

I have not much experience with btrfs yet, so I wonder if there is anything I could do to either work around or (better) to help fixing this (or both :P).

Or would you recommend that I do a re-install with a different FS that is more stable? (ext4? Or which FS would you recommend for a SSD? xfs? zfs? f2fs??)
(as far as I read, btrfs is considered to be quite stable already as long as I don't use some of the fancy features (e.g. some RAIDs) and that it is used for production servers by some large companies ...)

I do enjoy the COW and the snapshot functionality and how it is integrated with timeshift, and wouldn't want to miss this if possible!

Code: Select all

System:    Kernel: 5.8.0-33-generic x86_64 bits: 64 compiler: N/A Desktop: Cinnamon 4.6.7 wm: muffin 4.6.3 dm: LightDM 1.30.0 
           Distro: Linux Mint 20 Ulyana base: Ubuntu 20.04 focal 
Machine:   Type: Convertible System: ASUSTeK product: ZenBook UX562FAC_UX562FA v: 1.0 serial: <filter> 
           Mobo: ASUSTeK model: UX562FAC v: 1.0 serial: <filter> UEFI: American Megatrends v: UX562FAC.304 date: 05/06/2020 
CPU:       Topology: Quad Core model: Intel Core i7-10510U bits: 64 type: MT MCP arch: Kaby Lake rev: C L2 cache: 8192 KiB 
           flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx bogomips: 36799 
           Speed: 1864 MHz min/max: 400/4900 MHz Core speeds (MHz): 1: 1864 2: 2932 3: 1816 4: 2652 5: 2191 6: 1339 7: 1313 
           8: 2514 
Drives:    Local Storage: total: 953.87 GiB used: 344.23 GiB (36.1%) 
           ID-1: /dev/nvme0n1 vendor: Samsung model: MZVLB1T0HALR-00000 size: 953.87 GiB speed: 31.6 Gb/s lanes: 4 
           serial: <filter> rev: EXA7301Q scheme: GPT 
RAID:      Hardware-1: Intel Device driver: ahci v: 3.0 port: 3060 bus ID: 00:17.0 chip ID: 8086.02d7 rev: N/A 
Partition: ID-1: / size: 304.74 GiB used: 125.74 GiB (41.3%) fs: btrfs dev: /dev/nvme0n1p6 
           ID-2: /home size: 304.74 GiB used: 125.74 GiB (41.3%) fs: btrfs dev: /dev/nvme0n1p6 
           ID-3: swap-1 size: 15.26 GiB used: 0 KiB (0.0%) fs: swap dev: /dev/nvme0n1p5 
XFS is the fastest... the only one faster is F2FS but is not available on LM
LanceM

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by LanceM »

XFS is the fastest... the only one faster is F2FS but is not available on LM
It is fully supported. Install from the software manager

Code: Select all

F2fs-tools
damian101
Level 1
Level 1
Posts: 3
Joined: Mon Jan 04, 2021 4:44 pm

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by damian101 »

vonMos wrote: Mon Mar 29, 2021 12:49 pm XFS is the fastest... the only one faster is F2FS but is not available on LM
I did some benchmark recently (some workload with heavy I/O) on HDDs and btrfs with nodatacow and noatime was consistently a few percent faster than XFS with noatime.
Last edited by Moem on Thu Apr 08, 2021 8:41 am, edited 1 time in total.
Reason: Fixed a quote.
jrw32982
Level 1
Level 1
Posts: 45
Joined: Thu Dec 24, 2009 10:35 am

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by jrw32982 »

damian101 wrote: Mon Mar 29, 2021 12:01 am Edit 2: While manual snapshot creation and deletion through Timeshift happens instantly now, automatic snapshot creation and deletion seems to take just as long as before, more than 3 minutes combined, locking my filesystem during that period.
I can confirm that this happens for me too. I have turned off qgroups, but when my daily Timeshift happens (it always seems to pick midnight), my entire machine freezes for a couple of minutes. I am also using only SSDs. If I could shift the snapshot time to stick at 4am, I would live with it. Or better yet, it would be nice to fix the problem. I'm not sure if it is the old snapshot deletion that is causing the problem or the new snapshot creation, but it's very annoying. I'm getting to the point of considering turning off Timeshift.
User avatar
Larry78723
Level 14
Level 14
Posts: 5476
Joined: Wed Jan 09, 2019 7:01 pm
Location: Jasper County, SC, USA

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by Larry78723 »

@ilwegesk - Why are you doing hourly Timeshift snapshots? Are you making that many changes to the system or are you using it to also make snapshots of /home? If the second, it's the wrong tool for the job. I'd set up a cron job to backup just /home using TAR or rsync. Much less resource intensive that way.
Image
If you have found the solution to your initial post, please open your original post, click on the pencil, and add (Solved) to the Subject, it helps other users looking for help, and keeps the forum clean.
damian101
Level 1
Level 1
Posts: 3
Joined: Mon Jan 04, 2021 4:44 pm

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by damian101 »

Running

Code: Select all

sudo btrfs quota disable /
fixes the issue for me, at the cost of not being able to see the amount of unshared data a snapshot consumes. Option "Enable BTRFS qgroups" in Timeshift might need to be disabled as well.
ilwegesk
Level 2
Level 2
Posts: 68
Joined: Wed Sep 30, 2020 2:22 am

Re: btrfs-transcation at 100% CPU causes processes to hang for several minutes ...Which filesystem do you recommend for

Post by ilwegesk »

damian101 wrote: Mon Apr 19, 2021 8:25 pm Running

Code: Select all

sudo btrfs quota disable /
fixes the issue for me, at the cost of not being able to see the amount of unshared data a snapshot consumes. Option "Enable BTRFS qgroups" in Timeshift might need to be disabled as well.
This seems to work for me: I also had to deselect the option to "enable BTRFS qgroups (recommended)" - otherwise Timeshift did re-enable the quotas again. The down-side is that now the size of the snapshots is no longer displayed. I think that's what Timeshift uses the quotas for (don't understand the internals).

I also disabled hourly snapshots.
Locked

Return to “Software & Applications”