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

Thread: (BTRFS) System freezes with web browsers

  1. #1

    Default (BTRFS) System freezes with web browsers

    Hello Community,

    I have been struggling with the issue for a several months. I have changed the SSD to a new Crucial BX500 and the issue persists - system freezes untill I barely manage to kill the browser.
    The Laptop is an old one , if that is of any importance.

    So far I have noticed that only Web browsers (firefox/chrome) cause the issue, yet other tasks like video conversion does not trigger it.
    I have a suspicion that BTRFS is somehow overloaded , but I have no hard evidence for that.

  2. #2
    Join Date
    Nov 2009
    Location
    West Virginia Sector 13
    Posts
    15,899

    Default Re: (BTRFS) System freezes with web browsers

    How much memory?

    Browser? FireFox?

    Desktop??

    FF does not like to be short on memory.

  3. #3

    Default Re: (BTRFS) System freezes with web browsers

    Quote Originally Posted by gogalthorp View Post
    How much memory?

    Browser? FireFox?

    Desktop??

    FF does not like to be short on memory.
    Memory: 4G (usable 3.8Gi) with average use 1.9Gi
    Browser: Both Chrome & Firefox
    Desktop -> KDE

  4. #4
    Join Date
    Jul 2018
    Location
    Loma Linda, Mo
    Posts
    247

    Default Re: (BTRFS) System freezes with web browsers

    Do you have swap - even though Firefox may not need it - it seems to hang if there is not enough swap available.
    I have 32 gb of ram and had to add 4 gb swap for Firefox not to hang.
    Opensuse 15.1 with VirtualBox VM's (Windows 98, XP, 7, 8.1, 10 & OpenSUSE 15.0)

    Unix since 1974 (pdp-11 in "B" , Interdata 7/32 in "C") (AT&T, Tandy, Convergent, IBM, NCR, HP flavors)
    Linux since 1995 (mandrake, redhat, fedora, centos, now OpenSUSE)

  5. #5
    Join Date
    Mar 2020
    Location
    São Leopoldo, RS, Brazil
    Posts
    152

    Default Re: (BTRFS) System freezes with web browsers

    Before making changes to the system, it's best to understand what's going on. Tools like htop, atop, iotop, iostat can help diagnose what using system's resources.

    Also, let's see what I/O scheduler do you have. openSUSE currently identifies whether the system is running on spinning disks or SSDs and sets to an appropriate scheduler.

    Code:
    grep '\[.*\]' /sys/block/*/queue/scheduler
    That said, a couple tweaks can improve responsiveness. Proceed with monitoring for RAM usage and I/O, and whether it helps with responsiveness after each step.

    1) Disable caching to disk on Firefox

    Open firefox, and navigate to about:config, type browser.cache.disk.enable and set that to false (double-click).

    2) Reduce swap to disk

    Once the system achieves a given % load, it begins swapping to disk. This can be changed to a lower value = less swap activity.

    Read the current value. The default value, vm.swappiness=60, put's your system in a state that will perform swap often. The vm.vfs_cache_pressure settings controls how much the kernel reclaims memory holding inode entries.
    Code:
    sudo sysctl vm.swappiness
    sudo sysctl vm.vfs_cache_pressure
    Change to a lower number, say 10 (swapping starts at 10% free memory, I have it set to 1)

    Code:
    sudo sysctl -w vm.swappiness=10
    sudo sysctl -w vm.vfs_cache_pressure=50
    To make it permanent for the next boot, run this:

    Code:
    sudo tee /etc/sysctl.d/99-swap.conf >/dev/null <<EOF
    vm.swappiness=10
    vm.vfs_cache_pressure=50
    EOF
    Reference: https://doc.opensuse.org/documentati...ng-kernel.html
    openSUSE Tumbleweed

  6. #6

    Default Re: (BTRFS) System freezes with web browsers

    I have no swap dedicated:
    Code:
    mimi:~ # free -h
                  total        used        free      shared  buff/cache   available
    Mem:          3.8Gi       1.4Gi       820Mi       272Mi       1.6Gi       1.9Gi
    Swap:            0B          0B          0B
    SSD is using 'noop' , while rotating disk is using deadline.
    Code:
    mimi:~ # cat /sys/block/sd*/queue/scheduler 
    [noop] deadline cfq 
    noop [deadline] cfq
    I will try to disable disk caching on firefox and chrome.

  7. #7

    Default Re: (BTRFS) System freezes with web browsers

    After disabling disk caching for firefox, I still experience the problems.
    I guess I will need to use XFS/ext for /home

  8. #8
    Join Date
    Jun 2008
    Location
    Podunk
    Posts
    28,812
    Blog Entries
    15

    Default Re: (BTRFS) System freezes with web browsers

    Quote Originally Posted by hunter86_bg View Post
    After disabling disk caching for firefox, I still experience the problems.
    I guess I will need to use XFS/ext for /home
    Hi
    Don't see it here with btrfs, I do have a swap file and tweaked, but never seen Firefox use it.... Up over a day here zero swap used, multiple Firefox windows and tabs in use. I don't use those old schedulers.... mq-deadline with SSD, bfq for rotating rust (btrfs/xfs)....

    Code:
    cat /sys/block/sd*/queue/scheduler 
    [mq-deadline] kyber bfq none
    [mq-deadline] kyber bfq none
    mq-deadline kyber [bfq] none
    
    {Add to grub kernel options}
    
    scsi_mod.use_blk_mq=1
    I would suspect the noop causing issues should be cfq or deadline with btrfs....
    Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
    SUSE SLE, openSUSE Leap/Tumbleweed (x86_64) | GNOME DE
    If you find this post helpful and are logged into the web interface,
    please show your appreciation and click on the star below... Thanks!

  9. #9
    Join Date
    Jun 2008
    Location
    San Diego, Ca, USA
    Posts
    12,275
    Blog Entries
    2

    Default Re: (BTRFS) System freezes with web browsers

    IMO you should configure a swap partition (or swap file if you have very limited storage)
    All OS benefit from some swap, even if it's minimal.
    With 4GB RAM, you may also benefit by disabling unneeded bling if you're running KDE or Gnome... Or, if you run a different "lighter" desktop you won't have those extra loads by default.

    I see the Crucial BX500 comes in various sizes so you'll have to determine for yourself how and how much swap you can configure. One benefit of swap on an SSD is that I doubt you'll have to worry about contiguous blocks, if your swap becomes fragmented I doubt it would have any effect on performance.

    TSU
    Beginner Wiki Quickstart - https://en.opensuse.org/User:Tsu2/Quickstart_Wiki
    Solved a problem recently? Create a wiki page for future personal reference!
    Learn something new?
    Attended a computing event?
    Post and Share!

  10. #10

    Default Re: (BTRFS) System freezes with web browsers

    1. Add RAM. 8 GB is the minimum for a browsing in our times.
    2. With small amount of RAM use only one browser. Firefox is more tolerable to it.
    3. You need swap, especially with a low memory usage.
    4. Tune memory volume dedicated to a graphics chip. 256-512 MB is good enough.
    5. Use XFS or Ext4 instead of BTRFS.

Page 1 of 2 12 LastLast

Posting Permissions

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