1

I have big latency problems with my BTRFS filesystem configuration under Pop OS 20.04.

When I make updates, it freeze my computer and I have to wait sometimes 5 seconds just to refresh a web page on my browser.

To start iTunes on a Windows 10 virtual machine, it can take up to 6 minutes! And running the Windows 10 virtual machine is just horrible for my POP OS responsiveness.

Here is my configuration:

UUID=7e73aae9-1da1-4ea6-b8a5-20f5c2689f23  /  btrfs  defaults,subvol=@,ssd,noatime,space_cache,commit=15,compress=zstd  0  0
UUID=7e73aae9-1da1-4ea6-b8a5-20f5c2689f23  /home  btrfs  defaults,subvol=@home,ssd,noatime,space_cache,commit=15,compress=zstd  0  0
#UUID=7e73aae9-1da1-4ea6-b8a5-20f5c2689f23  /var/www  btrfs  defaults,subvol=@www,ssd,noatime,space_cache,commit=15,compress=zstd  0  0
UUID=7e73aae9-1da1-4ea6-b8a5-20f5c2689f23  /swap  btrfs  defaults,subvol=@swap,ssd,noatime,space_cache,commit=15  0  0

The partition is also encrypted with LUKS Encryption (version 2):

sudo cryptsetup luksDump /dev/nvme0n1p3 
LUKS header information
Version:        2
Epoch:          3
Metadata area:  16384 [bytes]
Keyslots area:  16744448 [bytes]
UUID:           08e59f5b-ec3e-4c3d-b383-82baeb7e8ece
Label:          (no label)
Subsystem:      (no subsystem)
Flags:          (no flags)

Data segments:
  0: crypt
    offset: 16777216 [bytes]
    length: (whole device)
    cipher: aes-xts-plain64
    sector: 512 [bytes]

Keyslots:
  0: luks2
    Key:        512 bits
    Priority:   normal
    Cipher:     aes-xts-plain64
    Cipher key: 512 bits
    PBKDF:      argon2i
    Time cost:  4
    Memory:     1048576
    Threads:    4
    Salt:       f8 8c b8 70 71 8a 49 a6 bb 72 76 34 fb cb ce a6 
                e2 95 44 82 6b f6 28 25 01 97 0e 2e 6b ea 0d de 
    AF stripes: 4000
    AF hash:    sha256
    Area offset:32768 [bytes]
    Area length:258048 [bytes]
    Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
    Hash:       sha256
    Iterations: 86802
    Salt:       6c 04 be 69 12 05 09 13 36 24 87 5d 8a 59 17 ab 
                82 9e c3 9f d7 3c 62 1c d3 29 8b 2a 29 eb 68 98 
    Digest:     f7 dd b2 93 03 ef 5c de 18 8b ba 21 c0 5f 9c c0 
                54 62 42 63 ec 39 aa 89 6d df db 88 3d e0 90 ac 

Does the latency issue comes more from the zstd compression or from the Luks encryption?

Should I change the compression type of all the disk?

London Smith
  • 1,622
  • 2
  • 18
  • 39
  • Also having this problem. Others have had similar issues. I wasn't experiencing this issue on Pop OS until upgrading to 21.10 in the past 2 months. I even did a clean install and am still having the issue. I've opened a ticket with System76 and will report back if I hear something. – Greg T. Feb 26 '22 at 19:10
  • For another example of someone having this problem, see here: https://www.reddit.com/r/pop_os/comments/ry72tb/really_poor_btrfs_performance_on_clean_install/ – Greg T. Feb 26 '22 at 19:12

1 Answers1

0

The luks encryption is probably the biggest latency hog. Than you can try to switch off zstd compression. Both take severely cpu cycles and cause your latency issues!

intrax
  • 1
  • 1
  • I have switched to Fedora 36 without modifying the default hard disk auto configuration and BTRFS is working like a charm. Very very fast. So I might have missed something on my configuration. – London Smith Jun 11 '22 at 12:56