[SOLVED] PCLinuxOS initscripts package overwrites swappiness setting.
Welcome, Guest.
"When tyranny becomes law, rebellion becomes duty." -Thomas Jefferson

Author Topic: [SOLVED] PCLinuxOS initscripts package overwrites swappiness setting.  (Read 402 times)

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
I'm currently trying to get an answer on the PCLinuxOS forums...  But I'm not very optimistic about getting a workaround.  I thought I might as well ask here, what you would do about this.

The problem is I'm running PCLinuxOS on an old duel core 4gig machine.  Setting the vm.swappiness = 10 works really good.  However I recently learned that every time the initscripts package gets updated it overwrites sysctl.conf setting the swappiness back to 60!  This makes this old machine run really slow.  I asked them "what I can do about it?"  But like I said, I'm not sure there is anything that can be done about it.  It also makes me curious if all rolling distros overwrite sysctl.conf when they update the initscripts package.



« Last Edit: June 25, 2021, 07:14:54 AM by Spatry »
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline CwF

  • Elite Member
  • *****
  • Posts: 474
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #1 on: June 23, 2021, 10:36:27 AM »
 Only actual swap activity slows the computer, with slow storage, while the swapping is taking place. Have you monitored the memory and swap usage? Before and after the swap activity there is no difference in performance.

 I've converted to zramswap alone, or with a traditional partition, depending...and as a result raised my swappiness to 30+.

Where are you putting your setting? Unless you are modifying a package file it should never be touched by an update. Your file should be /etc/sysctl.d/vm.swappiness.conf.

You can also echo in the value at any time for the session to (echo 10 >) /proc/sys/vm/swappiness.

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #2 on: June 23, 2021, 10:50:22 AM »
My swap is going to a SSD and it still slows down the system.


This is where every tutorial I've ever seen said to put the swappiness value.
/etc/sysctl.conf

https://www.howtoforge.com/tutorial/linux-swappiness/

Code: [Select]
# Kernel sysctl configuration file
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Disables IP dynaddr
net.ipv4.ip_dynaddr = 0
# Disable ECN
net.ipv4.tcp_ecn = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
#kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# If you set this variable to 1 then cd tray will close automatically when the
# cd drive is being accessed.
# Setting this to 1 is not advised when supermount is enabled
# (as it has been known to cause problems)
dev.cdrom.autoclose=1
# removed to fix some digital extraction problems
# dev.cdrom.check_media=1

# to be able to eject via the device eject button (magicdev)
dev.cdrom.lock=0

# Disable netfilter on bridges.
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_timestamps=1
net.ipv4.conf.all.log_martians=1
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_ignore_bogus_error_responses=1
fs.inotify.max_user_watches=524288
vm.dirty_ratio=20



vm.swappiness = 10

/etc/sysctl.d/vm.swappiness.conf. Does NOT exist.  Probably because this distro doesn't use systemd.

Code: [Select]
[family@localhost etc]$ ls
acpi/                   fonts/                libuser.conf            pacpl/             rsyslog.d/
adjtime                 foomatic/             locale/                 pam.d/             rwtab
alsa/                   fstab                 locale.conf             pango/             rwtab.d/
alternatives/           fstab.old             localtime@              papersize          samba/
anacrontab              fuse.conf             login.defs              passwd             sane.d/
anthy-conf              gconf/                logrotate.conf          passwd-            sasl2/
apm/                    ggi/                  logrotate.d/            pbm2ppa.conf       securetty
apparmor.d/             gimp/                 lsb-release             pclinuxos-release  security/
appstream.conf          gitweb.conf           lsb-release.d/          pcmcia/            sensors3.conf
apt/                    gnome-chess/          mailcap                 pkcs11/            services
asound.state@           gnome-vfs-2.0/        mailcap.vga             pki/               sgml/
at.deny                 gnome-vfs-mime-magic  makedev.d/              plymouth/          shadow
avahi/                  group                 man.config              pm/                shadow-
Backup/                 group-                mandrakelinux-release@  pnm2ppa.conf       shells
bash_completion.d/      grub-customizer/      mandrake-release@       PolicyKit/         signond.conf
bashrc                  grub.d/               mandriva-release@       polkit-1/          signon-ui/
bindresvport.blacklist  gshadow               maven/                  portreserve/       skel/
blkid/                  gshadow-              mc/                     power/             smartd.conf
bluetooth/              gss/                  mcc.conf*               ppp/               smartd_warning.sh*
bonobo-activation/      gtk-2.0/              mdns.allow              pptp.d/            snmp/
bpalogin.conf           gtk-3.0/              menu.d/                 printcap           sound/
chromium/               hal/                  mime.types              product.id         ssh/
cifs-utils/             hblock.d/             mke2fs.conf             profile            ssl/
conky/                  host.conf             modprobe.conf           profile.d/         statetab
ConsoleKit/             hostname              modprobe.d/             protocols          statetab.d/
cron.d/                 hosts                 modprobe.preload        pulse/             subversion/
cron.daily/             hosts.allow           modprobe.preload.d/     pythonrc.py        suspend.conf
cron.deny               hosts.deny            modules                 qtrc               sysconfig/
cron.hourly/            hotplug/              modules.conf            rc@                sysctl.conf
cron.monthly/           hp/                   motd                    rc0.d@             sysctl.d/
crontab                 httpd/                mpd.conf*               rc1.d@             timeshift/
cron.weekly/            ifplugd/              mpv/                    rc2.d@             ts.conf
cron.yearly/            iftab                 mtab                    rc3.d@             udev/
crypto-policies/        ifw/                  mtab.fuselock           rc4.d@             updatedb.conf
csh.cshrc               ImageMagick/          mtools.conf             rc5.d@             UPower/
csh.login               info-dir              my.cnf.d/               rc6.d@             usb_modeswitch.conf
cups/                   init.d@               nanorc                  rc.d/              vbox/
dbus-1/                 initramfs/            netconfig               rc_keymaps/        vconsole.conf
dconf/                  inittab               netgroup                rc.local@          version
default/                inputrc               netprofile/             rc_maps.cfg        video_format
depmod.d/               iproute2/             NetworkManager/         rc.modules*        vnstat.conf
DIR_COLORS              issue                 networks                rcS.d@             vulkan/
dkms/                   issue.net             nsswitch.conf           rc.sysinit@        wgetrc
draklive-install.d/     java/                 ntp/                    redhat-release@    wpa_supplicant.conf
dumpdates               jvm/                  ntp.conf                release@           X11/
dynamic/                jvm-commmon/          nvidia-current/         request-key.conf   xdg/
e2fsck.conf             kernel/               obex-data-server/       request-key.d/     xinetd.conf
e2scrub.conf            krb5.conf             openal/                 resolv.conf        xinetd.d/
egl/                    laptop-mode/          OpenCL/                 resolvconf/        xml/
emacs/                  ld.so.cache           openldap/               rmt@               xrdb/
environment             ld.so.conf            openssl/                rpc
esd.conf                ld.so.conf.d/         openvpn/                rpm/
filesystems             libaudit.conf         opt/                    rsyncd.conf
fish/                   libnl/                os-release@             rsyslog.conf

Code: [Select]
[family@localhost sysctl.d]$ ls
[family@localhost sysctl.d]$

If I (echo 10 >) /proc/sys/vm/swappiness  will that stay in the system that way?
« Last Edit: June 23, 2021, 11:00:33 AM by gregorylock »
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline CwF

  • Elite Member
  • *****
  • Posts: 474
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #3 on: June 23, 2021, 11:02:33 AM »
...and it's wrong. YOU need to create the file, that's how it survives. You don't modify package files, ever. (files that come with and updated by the package).

No, the echo is as I said 'for the session'.

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #4 on: June 23, 2021, 11:07:47 AM »
...and it's wrong. YOU need to create the file, that's how it survives. You don't modify package files, ever. (files that come with and updated by the package).

No, the echo is as I said 'for the session'.

You need to tell that to the people who are writing the tutorials!

Is this the file that I need to create?
vm.swappiness.conf

What do I need to put in it?
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #5 on: June 23, 2021, 11:10:27 AM »
This tutorial also tells me to edit the same config file.  The same one your telling me is WRONG!
https://docs.couchbase.com/server/current/install/install-swap-space.html
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #6 on: June 23, 2021, 11:24:46 AM »
Here is what I just tried.

I removed it from here:

Code: [Select]
cat /etc/sysctl.conf
# Kernel sysctl configuration file
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Disables IP dynaddr
net.ipv4.ip_dynaddr = 0
# Disable ECN
net.ipv4.tcp_ecn = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
#kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# If you set this variable to 1 then cd tray will close automatically when the
# cd drive is being accessed.
# Setting this to 1 is not advised when supermount is enabled
# (as it has been known to cause problems)
dev.cdrom.autoclose=1
# removed to fix some digital extraction problems
# dev.cdrom.check_media=1

# to be able to eject via the device eject button (magicdev)
dev.cdrom.lock=0

# Disable netfilter on bridges.
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_timestamps=1
net.ipv4.conf.all.log_martians=1
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_ignore_bogus_error_responses=1
fs.inotify.max_user_watches=524288
vm.dirty_ratio=20

Put it in here:

Code: [Select]
cat /etc/sysctl.d/vm.swappiness.conf
# /etc/sysctl.d/vm.swappiness.conf
vm.swappiness = 10

Rebooted and Checked

Code: [Select]
[root@localhost family]# sysctl vm.swappiness
vm.swappiness = 10
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline CwF

  • Elite Member
  • *****
  • Posts: 474
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #7 on: June 23, 2021, 11:42:16 AM »
So it worked!

 Refer 'man sysctl.conf' and you will see the 'Files' section, some don't exist because why would they?
Systemd works by parsing the defaults (the package file) and then any user set files.
The locations for user(site) config are detailed in the man's. If you modify the package file, this is how breakage upon update happens! ALL systemd functions follow this practice - it's the whole point!

My take, MOST of the internet is WRONG!

So if you follow, you now know how to properly modify systemd traits! Your mods ALWAYS go in a file YOU create. Any how-to that suggest modifying a package file is a hack. And of course it will work until the package is updated. During an update Debian will often offer up an inline editor to sync a package file that the user has modified. Those examples are not yet fully systemd compliant. The user file will override the defaults, so the value can be in both.

For the echo, drop my para's (). just 'echo 10 > /...'

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #8 on: June 23, 2021, 01:03:13 PM »
If you can't know if you found the proper information your screwed either way.  Man pages let me down too!
« Last Edit: June 23, 2021, 02:25:52 PM by gregorylock »
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline CwF

  • Elite Member
  • *****
  • Posts: 474
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #9 on: June 23, 2021, 02:00:18 PM »
Perhaps you should. Learning correct ways moves you forward, following the wrong keeps you put.

I've answered >90% of my own questions over the last few years simply asking the computer itself, not google. There is more info on the system than you know, obviously. Much is with the package docs, outside the man's. Much is within the commands themselves on the command line. My effort would be better spent improving those rather than typing to nowhere.

So, you're welcome. Next time I'll refrain. And NO, I don't assume it's my job to correct erroneous tutorials. You are more suited for that.

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #10 on: June 23, 2021, 02:05:17 PM »
You don't seem to understand my point of view or frustration.  I have never asked anyone to stop trying to help me before.  I think it would be best for the both of us.
« Last Edit: June 23, 2021, 02:25:21 PM by gregorylock »
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline Spatry

  • Benevolent Dictator
  • Administrator - Sysop
  • **********
  • Posts: 5839
  • Cup of Linux Founder
    • Cup of Linux
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #11 on: June 24, 2021, 07:26:41 AM »
One life lesson I can share is that if you practice with bad technique, your performance will always be sloppy; but if you are meticulous in your efforts your work will always shine.

I am guilty of finding many of my own solutions online and as CwF stated, there have been a number of times that the information I have found was not 100% correct. Since I prefer the ARCH ecosystem, I prefer to stay there as it is well documented rather than bouncing around like I did in my distro-hopping days.

Gregory, if you can take on the challenge, you might consider learning how to build Arch* or Gentoo, a whole world of understanding (and frustration) awaits you. I can say that I learned more in one weekend about computers (building Arch) than I have learned when using an OS set in front of me for over a decade. The frustration was worth it for me because now I understand my machine, when something goes wrong, I can fix it. I am still using Arch (and Manjaro on my spare) on my machines.
Windows assumes the user is an idiot... Linux DEMANDS Proof!

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #12 on: June 24, 2021, 08:11:33 AM »
Spatry not everyone can do ARCH!  The arch wiki makes my blood pressure go up, my head hurt, and my heart pound like crazy.  The last time I tried installing arch I couldn't even sleep at night.

I don't think CwF is good at explaining himself.  I had to re read his messages several times, and then sleep on it, before I could start to understand what He's trying to tell me!  He assumes too much.  I only know how to get information from man pages, those other docs He's talking about.  What is that?  How do you ask the computer?  I could get sarcastic and say "I'll google how to ask the computer".  I don't want to go back to Windows, but this kind of thing temps me.
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs

Offline CwF

  • Elite Member
  • *****
  • Posts: 474
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #13 on: June 24, 2021, 10:03:19 AM »
Simple - the internet is wrong on so much of Linux's details for one simple reason. When you search on any of many topics you get 20+ years of answers. Likely, revisions have taken place, methods change and evolve - while the results stay static. Subjects like systemd, pkexec, qemu/kvm, sudo('s), iptables, etc - much reference is wrong because it's out of date. The ultimate reference is the given running distro. Documentation is hard, nothing new that it's incomplete. The file contents you posted - that is part of the documentation, it stated the relevant man pages right there. The goal is 'self-documeted', so packages have the how-to blended into many of it's files, in /etc/* and /etc/defaults/* and /usr/share/doc/*. Relevant and not obvious here is 'man systemd'
 Also 'man locate'. Follow a trail, poke around, that's how you ask the computer. Learn to learn.

Offline gregorylock

  • Contributor
  • *******
  • Posts: 1178
Re: PCLinuxOS initscripts package overwrites swappiness setting.
« Reply #14 on: June 24, 2021, 10:18:32 AM »
Learn to learn

It's nice of you to share clear information.  But don't be so condescending, and arrogant.  You act as if I don't want to learn, etc.

Update:

I originally said.  It's nice of you to share clear information.  But after rereading several more times, I realized it made me more confused.  I had to reread you 5 times before I could understand what you were referring too when you said "The file contents you posted".  I assume you mean this:  You know it's worth using links and examples to give visual aids of what your talking about...

Code: [Select]
cat /etc/sysctl.conf
# Kernel sysctl configuration file
#
# For binary values, 0 is disabled, 1 is enabled.  See sysctl(8) and
# sysctl.conf(5) for more details.

# Disables IP dynaddr
net.ipv4.ip_dynaddr = 0
# Disable ECN
net.ipv4.tcp_ecn = 0
# Controls source route verification
net.ipv4.conf.default.rp_filter = 1

# Do not accept source routing
net.ipv4.conf.default.accept_source_route = 0

# Controls the System Request debugging functionality of the kernel
#kernel.sysrq = 0

# Controls whether core dumps will append the PID to the core filename.
# Useful for debugging multi-threaded applications.
kernel.core_uses_pid = 1

# If you set this variable to 1 then cd tray will close automatically when the
# cd drive is being accessed.
# Setting this to 1 is not advised when supermount is enabled
# (as it has been known to cause problems)
dev.cdrom.autoclose=1
# removed to fix some digital extraction problems
# dev.cdrom.check_media=1

# to be able to eject via the device eject button (magicdev)
dev.cdrom.lock=0

# Disable netfilter on bridges.
net.ipv4.conf.all.rp_filter=1
net.ipv4.tcp_window_scaling=1
net.ipv4.tcp_timestamps=1
net.ipv4.conf.all.log_martians=1
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_ignore_bogus_error_responses=1
fs.inotify.max_user_watches=524288
vm.dirty_ratio=20
« Last Edit: June 24, 2021, 10:50:16 AM by gregorylock »
Real Hardware: Linux Mint 20.1 XFCE, PCLinuxOS XFCE
VirtualBox:  ArchLabs