kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 12, 2022 12:02:42 GMT
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 12, 2022 15:16:01 GMT
Hello kiezelAt what point should CPU use be considered too much to provide no benefit. For instance, I have desktop pc with dual core processor @ 1.8 GHz with 4 GB RAM. I have swappiness set to 0. 13 hours after reboot it has swapped 268 KB of RAM. If I start up another web browser it might go up to 4 MB swap.
|
|
enigma9o7
Crew Member
 
Posts: 1,116
Likes: 1,151
Member is Online
|
Post by enigma9o7 on Jan 12, 2022 15:33:22 GMT
It's not CPU that would make it no benefit, its if you have enough memory that it provides no benefit, in fact slows you down. Certainly if you have very little memory, it's better than swapping. But if you're able to stay out of swap normally, adding zram will slow things down... plus it breaks hibernation....
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 12, 2022 16:13:59 GMT
It's not CPU that would make it no benefit, its if you have enough memory that it provides no benefit, in fact slows you down. Certainly if you have very little memory, it's better than swapping. But if you're able to stay out of swap normally, adding zram will slow things down... plus it breaks hibernation.... Yes I was wondering about the swap also. I have 4 GB swap partition. It never reaches 1 GB of swap. So using a small amount of swap, occasionally, what would be the preferred method. 1. leave it alone 2. use zswap 3. who knows, just try it and see 
|
|
kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 12, 2022 16:41:30 GMT
3. who knows, just try it and see Exactly that's my recommendation. With the specs you mentioned, I think you'll be agreeably surprised. 
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 13, 2022 2:07:23 GMT
Oops. There is an unforeseen issue. dmesg | grep -i zswap [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-94-generic root=UUID=06acf278-48bd-4ad6-8984-844ec49a944e ro quiet splash zswap.enabled=1 zswap.compressor=lz4 [ 0.057389] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-94-generic root=UUID=06acf278-48bd-4ad6-8984-844ec49a944e ro quiet splash zswap.enabled=1 zswap.compressor=lz4 [ 0.968847] zswap: compressor lz4 not available, using default lzo [ 0.968896] zswap: loaded using pool lzo/zbud lz4 not available 
|
|
kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 13, 2022 9:26:10 GMT
Oops. There is an unforeseen issue. dmesg | grep -i zswap [ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-94-generic root=UUID=06acf278-48bd-4ad6-8984-844ec49a944e ro quiet splash zswap.enabled=1 zswap.compressor=lz4 [ 0.057389] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-5.4.0-94-generic root=UUID=06acf278-48bd-4ad6-8984-844ec49a944e ro quiet splash zswap.enabled=1 zswap.compressor=lz4 [ 0.968847] zswap: compressor lz4 not available, using default lzo [ 0.968896] zswap: loaded using pool lzo/zbud lz4 not available  OK... You definitely want lz4 compression, because that's simply better than the default lzo compression. But apparently in your Bodhi, the module for the lz4 feature isn't included in the initramfs at boot time. So let's change that: pkexec leafpad /etc/initramfs-tools/modules In that text file, create a new bottom line with lz4 in it, so that it becomes: # List of modules that you want to include in your initramfs. # They will be loaded at boot time in the order below. # # Syntax: module_name [args ...] # # You must run update-initramfs(8) to effect this change. # # Examples: # # raid1 # sd_mod lz4 Save the changes and close the text editor. Then in the terminal: sudo update-initramfs -u Reboot. After the reboot, test again by running: dmesg | grep zswap
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 13, 2022 20:31:10 GMT
OK... You definitely want lz4 compression, because that's simply better than the default lzo compression. But apparently in your Bodhi, the module for the lz4 feature isn't included in the initramfs at boot time. So let's change that: # Examples: # # raid1 # sd_mod lz4 I also found a tutorial at ubuntu-mate.community/t/enable-zswap-to-increase-performance/11302They are suggesting, in addition to adding lz4 also adding lz4_compress. Do you think it's needed.
|
|
kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 13, 2022 20:44:39 GMT
They are suggesting, in addition to adding lz4 also adding lz4_compress. Do you think it's needed. No. I recommend to tread lightly in this matter; speed tweaks are known to be riddled with advice from "cowboys", whereas I strive for rock-solid performance. 
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 13, 2022 22:39:29 GMT
Here's an interesting output from sudo update-initramfs -u
update-initramfs: Generating /boot/initrd.img-5.4.0-94-generic I: The initramfs will attempt to resume from /dev/sda5 I: (UUID=03a3df77-b7a3-43a4-ac47-6888b568dbc0) I: Set the RESUME variable to override this.
My sda5 is the swap partition. Bodhi is on sda8.
Should I set the RESUME variable. I'm not having boot issues so perhaps ignore this?
|
|
enigma9o7
Crew Member
 
Posts: 1,116
Likes: 1,151
Member is Online
|
Post by enigma9o7 on Jan 14, 2022 1:59:06 GMT
What normally happens when you hibernate is it writes the contents of ram to the swap file or swap partition (whichever you're using), and that resume stuff is so it knows where to resume from. My understanding is that zram breaks hibernation. You won't be able to resume anyway.
|
|
kev392
Crew Member
 
Posts: 353
Likes: 469
|
Post by kev392 on Jan 14, 2022 3:38:40 GMT
What normally happens when you hibernate is it writes the contents of ram to the swap file or swap partition (whichever you're using), and that resume stuff is so it knows where to resume from. My understanding is that zram breaks hibernation. You won't be able to resume anyway. My computer is not a bear so it doesn't hibernate I will ignore the message about sd5. I am using Psensor to monitor cpu temperature. The zswap adds more work to the cpu. I'm not noticing any real increase for now. It typically runs between 40-50 celcius. inxi shows 3-5 degrees higher. I assume Psensor is more accurate.
|
|
|
Post by oblio on Jan 18, 2022 22:46:23 GMT
|
|
kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 19, 2022 10:13:09 GMT
Cool! I'm currently testing the addition of z3fold into the zswap mix, because that allows for higher compression than the default zbud (factor 3 instead of factor 2, thus enlarging the available zswap by 50 %). Reports about z3fold on the web are mostly positive, but some report slower performance than with zbud. This may have something to do with the CPU speed: obviously, the CPU needs to work harder with z3fold than with zbud. So my preliminary assumption is, that z3fold might be best for relatively powerful (recent!) CPUs, whereas the default zbud might be best for rather weak (old) CPUs.
|
|
kiezel
Crew Member
 
Posts: 143
Likes: 219
|
Post by kiezel on Jan 19, 2022 13:12:17 GMT
On second thought, the speed difference between zbud and z3fold on old machines, is irrelevant.... Because those old machines nearly always have slow, spinning platter disks, so every avoidance of using the swap on the HDD is invariably pure gain.
Therefore, I'm modifying my how-to's in order to incorporate z3fold unconditionally.
|
|