Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

  1. #1
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    763

    Default Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    I need urgent help with a major issue. I just preformed a fresh install of openSUSE Tumbleweed. I am now able to log in, however my machine is so slow I'm barely able to use it and even write this post.

    I managed to log in from root and catch a glimpse of what's happening with "top": There are two processes called btrfs-cleaner and btrfs-transacti. The two are using 100% of my CPU, to the point where the rest of the system has no resources left to operate. The horrifying part is that it's completely impossible to kill them, something I've never experienced with any other process before: The command "kill -9 PID" does nothing to them, they are essentially being forced onto my system.

    How do I get rid of them please? I managed to search for a bit of info: They're apparently related to some snapshot backup mechanism that's part of btrfs. I've never heard of it before so this is completely new to me, my previous install was on an ext4 partition so I've never ran into those things. What am I supposed to do to prevent this issue please?
    openSUSE Tumbleweed x64, KDE Framework 5

  2. #2
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    763

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    A quick update on the situation: It appears that after several minutes, the two processes have disappeared on their own. I'm no longer seeing them in "top" and my machine is no longer freezing up and needing to be restarted. I'm currently afraid to reboot as they might come back once the computer starts up again. I'll wait for someone to enlighten me on what exactly they're doing and what they are, potentially how to disable this snapshot system if it's not necessary.
    openSUSE Tumbleweed x64, KDE Framework 5

  3. #3
    Join Date
    Jun 2008
    Location
    Groningen, Netherlands
    Posts
    19,853
    Blog Entries
    14

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Quote Originally Posted by MirceaKitsune View Post
    A quick update on the situation: It appears that after several minutes, the two processes have disappeared on their own. I'm no longer seeing them in "top" and my machine is no longer freezing up and needing to be restarted. I'm currently afraid to reboot as they might come back once the computer starts up again. I'll wait for someone to enlighten me on what exactly they're doing and what they are, potentially how to disable this snapshot system if it's not necessary.
    I wouldn't disable snapshotting. My educated guess is that this was a a one time issue; I've seen it once on my laptop, immediately after install and first zypper dup, never again.
    ° Appreciate my reply? Click the star and let me know why.

    ° Perfection is not gonna happen. No way.

    https://en.opensuse.org/openSUSE:Board#Members
    http://en.opensuse.org/User:Knurpht
    http://nl.opensuse.org/Gebruiker:Knurpht

  4. #4
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    763

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Quote Originally Posted by Knurpht View Post
    I wouldn't disable snapshotting. My educated guess is that this was a a one time issue; I've seen it once on my laptop, immediately after install and first zypper dup, never again.
    I literally wanted to nuke it from my system at first, the experience was quite scary since I didn't know what was happening. After my last post it only did this a few more times briefly, and so far it seems to be slowly getting rarer and rarer. Indeed I imported a lot of system packages from my old install then did a "zypper dup" too, many things happened at once. I was not aware of this mechanism at all till the freezes so at first I thought my new SSD had hardware access issues.

    From what I could deduct, this is a Linux equivalent to the System Restore feature in Windows? It seems to use btrfs subvolumes to keep copies of files modified by YaST or system updates, which grub2 then lets you account for when booting.

    For safety however, I'd really like to know if there's a way to kill those processes when they're about to freeze the system. "kill -9 PID" doesn't affect them, which I find pretty scary since IIRC the system shouldn't allow an immortal process.

    Otherwise I'd still suggest the admins to please check the default process priority (niceness) for those snapshot processors. I wouldn't have minded if it just made the system slower a bit, but they rendered it completely unusable (not even NumLock / CapsLock leds could be toggled for 5 minutes). Blender 3D uses 100% of all CPU cores when it's rendering, and even then the system runs perfectly fine... I'm surprised at how this managed to top even its resource usage.
    openSUSE Tumbleweed x64, KDE Framework 5

  5. #5
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    763

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Now that I understand the system somewhat, I still had one more question about those snapshots. Figured it's not worth opening another thread since I just made this one, plus it's related to the performance issues too.

    Is there a limit to how many of them will get generated before old ones start being deleted? Either in GB (size used by the .snapshots directory), in number of total snapshots, or based on date (prune snapshots older than X months). I don't want this system to pointlessly take up space on my drive, especially since it's an SSD and I don't seek to reduce its lifetime by doing pointless reads / writes on it. If there's no limit it may eventually get to a point where you can't install new packages due to drive space, all to maintain some ancient changes which would be impossible to try reverting after so much time has passed and the packages and settings have radically changed.
    openSUSE Tumbleweed x64, KDE Framework 5

  6. #6
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,746

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Snapshots are not actually copies. They are just deleted or changed blocks that are preserved until released plus a bit of meta data to index it. So really not much writing is done.

    You can set how many and often snapshots are taken and how long they are perserved


    https://en.opensuse.org/Portal:Snapper

  7. #7

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    I have the same problem on my laptop (i7-8550U/256GB SSD/1 TB HDD/16GB RAM) with Leap 15.0. Btrfs is used on root partition (on SSD), as suggested by default install. From time to time, snapshots are created and it lasts from a couple of minutes to ten-twenty minutes. During that time, laptop can't be used at all (especially when btrfs-transacti uses 100% of CPU). Last night right after midnight, btrfs-transacti/btrfs/btrfs-balance occupied CPU fully (100%), and I simply can't do anything since then. The only time when I can interact with the laptop is during switching between the three btrfs tasks. After reboot, btrfs tasks just continued to work and occupy the CPU. I left the laptop at home (to complete the snapshot if that is the reason). Could the monthly snapshot be the reason for this and is there any suggestion how to avoid similar situations?

    Thanks!

  8. #8

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    I'm sad to say I have this problem too with my laptop (Leap 15) - though not on my desktop with the exact same setup partition-wise.
    Yesterday, the laptop couldn't boot until the whole btrfs-xxx process was done. It lasted Two. Full. Hours

  9. #9
    Join Date
    Jan 2009
    Location
    Romania, Bucharest
    Posts
    763

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Quote Originally Posted by bartvaes View Post
    I'm sad to say I have this problem too with my laptop (Leap 15) - though not on my desktop with the exact same setup partition-wise.
    Yesterday, the laptop couldn't boot until the whole btrfs-xxx process was done. It lasted Two. Full. Hours
    Yes... that matches exactly what I observed back then. And remember I experienced this on my desktop computer, with a powerful CPU and a fast SSD drive: I can't imagine how a laptop could even handle it.

    This is a VERY dangerous default setting. I still believe the installer should immediately stop defaulting to BTRFS with snapshots and instead recommend EXT4. Sadly the maintainers believe there are good reasons to keep that, which I honestly cannot understand yet.
    openSUSE Tumbleweed x64, KDE Framework 5

  10. #10

    Default Re: Computer frozen by btrfs-cleaner & btrfs-transacti using 100% CPU

    Hi
    I have similar issue, after wakeup from suspend, laptop freezes for few minutes, checked htop and seems like btrfs services cause cpu spike.
    Any solution or config tweak to solve this? maybe some snapshot shedule tuning?

Page 1 of 2 12 LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •