You are not logged in.
Pages: 1
Topic closed
HI. I had a working arch system for over 2 years but I decided to start fresh with a new encrypted filesystem. So I used the new archinstall script and made a btrfs + luks encryption + zstd compression + btrfs subvolumes setup. This is pretty much all the recommended settings in the archinstall for btrfs.
Everything seems to work just fine except when I have moderately high disk usage like copying files from another disk or downloading games on Steam I get lags and freezes. Random programs seem to become very slow or just freeze for few seconds. I can have htop working and refreshing itself while firefox is completely unresponsive (still playing the YouTube video though).
Keep in mind that I have an nvme ssd so 2000+mb read/write should be possible and I'm downloading games at ~11mb/s.
Here are some logs from iostat 1 -sxt
06/08/2022 08:59:09 PM
avg-cpu: %user %nice %system %iowait %steal %idle
1.50 1.59 5.76 0.33 0.00 90.81
Device tps kB/s rqm/s await areq-sz aqu-sz %util
dm-0 8.00 2728.00 0.00 9.25 341.00 0.07 5.80
nvme0n1 20.00 2132.00 0.00 6.50 106.60 0.13 5.80
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06/08/2022 08:59:10 PM
avg-cpu: %user %nice %system %iowait %steal %idle
1.51 1.59 3.86 15.94 0.00 77.10
Device tps kB/s rqm/s await areq-sz aqu-sz %util
dm-0 60.00 32608.00 0.00 494.93 543.47 29.70 100.20
nvme0n1 254.00 29904.00 1.00 73.73 117.73 18.73 98.40
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06/08/2022 08:59:11 PM
avg-cpu: %user %nice %system %iowait %steal %idle
1.34 1.59 4.02 20.33 0.00 72.72
Device tps kB/s rqm/s await areq-sz aqu-sz %util
dm-0 95.00 26424.00 0.00 1647.35 278.15 156.50 100.00
nvme0n1 268.00 29220.00 3.00 94.87 109.03 25.43 100.00
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00
06/08/2022 08:59:12 PM
avg-cpu: %user %nice %system %iowait %steal %idle
1.51 1.34 3.77 10.47 0.00 82.91
Device tps kB/s rqm/s await areq-sz aqu-sz %util
dm-0 80.00 26932.00 0.00 2490.43 336.65 199.23 99.80
nvme0n1 245.00 27220.00 1.00 102.03 111.10 25.00 99.80
sda 0.00 0.00 0.00 0.00 0.00 0.00 0.00
sdb 0.00 0.00 0.00 0.00 0.00 0.00 0.00
100% disk usage when just downloading and depacking a steam game ? Weird. I've read online that the encryption and btrfs compression is not that expensive to worry about so I hope there's another simpler problem to be solved (besides I don't want to wipe my disk again ) Swap is off btw (just turned it off now) but it doesn't change anything.
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
sda 8:0 0 465.8G 0 disk
├─sda1 8:1 0 529M 0 part
├─sda2 8:2 0 100M 0 part
├─sda3 8:3 0 16M 0 part
└─sda4 8:4 0 465.1G 0 part
sdb 8:16 1 7.5G 0 disk
├─sdb1 8:17 1 775M 0 part
└─sdb2 8:18 1 86M 0 part
zram0 253:0 0 0B 0 disk
nvme0n1 259:0 0 953.9G 0 disk
├─nvme0n1p1 259:1 0 509M 0 part /boot
└─nvme0n1p2 259:2 0 953.4G 0 part
└─cryptlvm 254:0 0 953.4G 0 crypt /home
/var/log
/var/cache/pacman/pkg
/.snapshots
/
CPU: AMD Ryzen 5 2600 (12) @ 3.400GHz
RAM: 16GB
Kernel: 5.18.2-260-tkg-pds (same thing happens on the stock kernel too !)
Offline
Bump. Any tips ? What to check, what to try ?
Offline
Don't do that. https://wiki.archlinux.org/title/Genera … es#Bumping
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
Keep in mind that I have an nvme ssd
luks encryption + zstd compression
I guess the problem doesn't exist when downloading to the unencrypted sda/b?
I've read online that
Do we really have to talk about that?
I'd first run "cryptsetup benchmark" and compare the results w/ the algo you chose.
You might also want to try w/o compression to see whether that's the immediate cause - then maybe adjust the compression algo or the overall approach (rather not compress-force, maybe only chttr +c or frequent defrag -c, https://btrfs.wiki.kernel.org/index.php/Compression )
Offline
Keep in mind that I have an nvme ssd
luks encryption + zstd compression
I guess the problem doesn't exist when downloading to the unencrypted sda/b?
I've read online that
Do we really have to talk about that?
I'd first run "cryptsetup benchmark" and compare the results w/ the algo you chose.
You might also want to try w/o compression to see whether that's the immediate cause - then maybe adjust the compression algo or the overall approach (rather not compress-force, maybe only chttr +c or frequent defrag -c, https://btrfs.wiki.kernel.org/index.php/Compression )
Thanks for the suggestions. I think I actually have compression disabled since I don't see it listed in the mount options
/dev/mapper/cryptlvm on / type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=256,subvol=/@)
/dev/mapper/cryptlvm on /.snapshots type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=257,subvol=/@.snapshots)
/dev/mapper/cryptlvm on /var/cache/pacman/pkg type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=260,subvol=/@pkg)
/dev/mapper/cryptlvm on /home type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=258,subvol=/@home)
/dev/mapper/cryptlvm on /var/log type btrfs (rw,relatime,ssd,space_cache=v2,subvolid=259,subvol=/@log)
My disk is encrypted using aes-xts-plain64
/dev/mapper/cryptlvm is active and is in use.
type: LUKS2
cipher: aes-xts-plain64
keysize: 512 bits
key location: keyring
device: /dev/nvme0n1p2
sector size: 512
offset: 32768 sectors
size: 1999321088 sectors
mode: read/write
This is the result of cryptsetup benchmark for this cipher
$ cryptsetup benchmark --cipher aes-xts-plain64 --key-size 512
# Tests are approximate using memory only (no storage IO).
# Algorithm | Key | Encryption | Decryption
aes-xts 512b 2204.3 MiB/s 2224.2 MiB/s
Also I looked at how the computer behaves when copying these files again. I can consistently cause freezes by copying this one directory with data around (about 7gb, mostly large files inside).
What I notice is that for the first 5-10 seconds it all goes normal, it's around 400mb/s (about the max read speed of my second disk). and the cp process takes about 20% of the cpu. Everything else is running just fine in the background. Then at some point the computer stars lagging, but the CPU is still at low usage. All the processes start to slow down, the cp goes all the way down to 0%, so does firefox and other stuff. It's as if all these user space tasks didn't run at all, execution is stuck in kernel space ?
Copying the same folder to the other unencrytped disk causes no problems.
#/tmp/win is mounted unencrypted disk, home is encrypted nvme disk
$ time cp -r ~/games/fallout_nv/ /tmp/win/
real 0m30.710s
user 0m0.027s
sys 0m9.794s
$ time cp -r /tmp/win/fallout_nv ~/
real 1m37.358s
user 0m0.018s
sys 0m8.069s
#this took over a minute more and that's about how long the computer was frozen for while copyig
Last edited by dudeguy (2022-06-12 22:02:32)
Offline
What I notice is that for the first 5-10 seconds it all goes normal, it's around 400mb/s
Likely just cache.
dd if=/dev/zero of=/home/username/foo.dd oflag=direct count=1M # default bs is 512, so 512MB
The encryption looks accelerated, so that's "for free".
How do you monitor the CPU? top/htop?
Do you show kernel processes?
How does the RAM usage develop?
Are there IO errors in dmesg?
If you run a CPU intense process that's IO-free (hopefully), is that affected?
time echo "scale=5000; a(1)*4" | bc -l # don't post the result - it's Pi, just check the CPU and time stats
Offline
btrfs + luks encryption + btrfs subvolumes setup.
downloading games on Steam I get lags and freezes. Random programs seem to become very slow or just freeze for few seconds
I have an nvme ssd
You are not alone, I have same issue - high iowait up to 50%.
Offline
The OP has not been back since June, so I am going to consider this thread abandoned and close it.
How to post. A sincere effort to use modest and proper language and grammar is a sign of respect toward the community.
Offline
Pages: 1
Topic closed