Page 1 of 1

[SOLVED] Cannot configure swap

PostPosted: May 29th, '21, 10:30
by kateto
Hello,
I can't seem to configure swappiness at boot. Doing it at runtime seems to work:
Code: Select all
[root@Fractal ~]# sysctl vm.swappiness
vm.swappiness = 60
[root@Fractal ~]# sysctl -w vm.swappiness=10
vm.swappiness = 10
[root@Fractal ~]# sysctl vm.swappiness
vm.swappiness = 10

However, Mageia doesn't pick up the settings I put at /etc/sysctl.conf at boot:
Code: Select all
vm.swappiness=10
vm.vfs_cache_pressure=50

This already happened in Mageia 7 and hasn't changed in Mageia 8.
By the way, the original sysctl.conf had "vm.swapiness", which I think is a typo. I changed it to "vm.swappiness" but that didn't make a difference.

Re: Cannot configure swap

PostPosted: May 29th, '21, 11:42
by doktor5000
Check the man-page for sysctl.d - it should be put in a config droplet below /etc/sysctl.d because /etc/sysctl.conf is not read anymore by default by systemd - this has already been the case for quite some time.
If you change some sysctl via MCC then you should usually have a symlink /etc/sysctl.d/99-sysctl.conf to /etc/sysctl.conf from what I remember. See https://bugs.mageia.org/show_bug.cgi?id=12066

Re: Cannot configure swap

PostPosted: May 29th, '21, 12:54
by kateto
Thanks for the reply, putting the parameters in /etc/sysctl.d/99-sysctl.conf took care of the issue.
Truly, discarding out old, non-valid info is one of the biggest hurdles of Linux users. There are so many vestigial components lying around like appendices, just to confound users...

Re: Cannot configure swap

PostPosted: May 31st, '21, 19:56
by jiml8
kateto wrote:Truly, discarding out old, non-valid info is one of the biggest hurdles of Linux users. There are so many vestigial components lying around like appendices, just to confound users...


It would be far, far better if that nasty POS systemctl would update configurations when it was changed in a fashion that breaks compatibility. But nooooooooo...

Re: Cannot configure swap

PostPosted: May 31st, '21, 20:56
by isadora
jiml8 wrote:
kateto wrote:that nasty POS...

Come on Jim, you can do that much better, i know..... :D

Re: Cannot configure swap

PostPosted: Jun 1st, '21, 22:23
by jiml8
Yeah. I could.

When I write something, I am always careful to retain backward compatibility. Should that prove unfeasible, I always build in a migration path and handle the migration.

Systemd has broken my system over, and over, and over. I am very reluctant to update these days because I may wind up with a broken system and be forced to retrace all my steps to see what got broken this time.

For instance, I was not aware that sysctl.conf was no longer being used, until I read it in this thread. Why is sysctl.conf now being ignored? No good reason. Just "we no longer want to do it this way".

Well, that change turns out to be at the root of a number of problems that have been annoying me lately...things I had fixed before with sysctl settings had become unfixed and I had not yet taken the time to chase them down. I had, in fact, not recognized that my sysctl settings had been removed. This includes my complaints about kcompactd. Once I reset my sysctl settings, THAT problem disappeared and my system swap behavior settled down.

Linux with systemd is actually now a lot worse than Windows with respect to updates. At least, Windows fixes the configuration of the system being updated when it changes how things are done. And, mostly, that works. But not linux.

Re: [SOLVED] Cannot configure swap

PostPosted: Jun 1st, '21, 23:10
by doktor5000
Yeah, it's kinda sad for some parts - the migration part is left to the distribution, instead of handling it directly upstream.

But back on topic, you should have a /etc/sysctl.d/99-sysctl.conf which is a symlink to /etc/sysctl.conf by default. If not, feel free to submit a patch for the above mentioned bugreport or create a new one. Problem is we currently don't have any active maintainer for our initscripts, which is probably the cause why this is not fixed in all cases.