You are not logged in.

#1 2020-10-16 18:24

paulus
Member
Registered: 2019-01-26
Posts: 6

How to reduce or eliminate swappiness in Q4OS 3.12 (64bit)? [SOLVED]

Hi all,

I really enjoy Q4OS 3.12, x64! It is really fast and steady!

I tried to reduce swappiness as found all over the internet: by changing the number in /proc/sys/vm/swappiness. I put it to 0 (zero). To be sure I logged out and in again, and checked the number via cat /proc/sys/vm/swappiness, and the input was indeed 0 (zero).

But in Htop it is indicated with 45,2M of 8.00G! How is that possible? Is it necessary to delete my swap partition (8GB)?

Help would be highly appreciated: thanks!

paulus

Last edited by paulus (2020-10-17 16:15)

Offline

#2 2020-10-17 06:13

bin
Member
From: U.K.
Registered: 2016-01-28
Posts: 842

Re: How to reduce or eliminate swappiness in Q4OS 3.12 (64bit)? [SOLVED]

If you are showing an 8Gb swap ptn then I guess you have 4Gb RAM.

Obviously a lot depends on what sort of stuff you do, but unless you are aware that you are already exceeding your available RAM you can get away with a much smaller swap. The 'double RAM' figure was fine back in the day when 1Gb was a lot and 2Gb massive. These days not so relevant.

As to the value you have used. 0 means that swap is disabled until your RAM is full. Bad idea - you could wind up with a frozen system.

A value of 10 will reduce the aggressiveness of swapping to a low value. You could even go down to 5 if you feel like it.

Why you want to do this is up to you.

Remember that changing /proc/...../swappiness is temporary and needs to be reset on reboot.

To make it permanent you need to create /etc/sysctl.d/100-swap.conf with a line  vm.swappiness="your value". Save.

The reason for the 100- is because there is a symlink @99-sysctl.conf

The recommended action of editing /etc/sysctl.conf is not guaranteed to survive updates and other activities.

As to the 45Mb - no idea unless it's a side effect of setting your value to 0 - a bit like formatting a partition - you don't get the full size because of FS data. But that's a guess.

Offline

#3 2020-10-17 10:56

paulus
Member
Registered: 2019-01-26
Posts: 6

Re: How to reduce or eliminate swappiness in Q4OS 3.12 (64bit)? [SOLVED]

Thank you, Bin, for answering.

No, my RAM is 8 GB. The according SWAP space is for hibernating (which I hardly do, BTW!).

After rebooting, not just logging out and back in again, the amount of SWAP is still 0 (zero), so I guess the indication of Htop before rebooting, has to do with the fact that the customizing of the SWAP value is only affected by rebooting and not by logout and login back in alone.

I did alter the file etc/sysctl.conf, and in that file I added

#Set swappiness to 0 to avoid swapping
vm.swappiness = 0

And that worked, at least as till now! I understand that this may change after altering or updating. Anyway, I noticed that the swappiness value is set permanent by rebooting, and not by just logging out and back in again.

Thank you for the suggestion not to put swappiness to 0, but to 5 or 10: I will remember that, and will adjust the number if freezing occurs.

Cheers!

Offline

Board footer

Powered by FluxBB