Bug 29191 - Default vm.swappiness and vm.vfs_cache_pressure settings result in poor responsiveness on larger ram desktop systems
Summary: Default vm.swappiness and vm.vfs_cache_pressure settings result in poor respo...
Status: REOPENED
Alias: None
Product: Mageia
Classification: Unclassified
Component: Release (media or process) (show other bugs)
Version: Cauldron
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia tools maintainers
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-06-30 12:34 CEST by peter lawford
Modified: 2021-07-01 19:25 CEST (History)
3 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description peter lawford 2021-06-30 12:34:10 CEST
Description of problem:I have 64 GB of ram, and I wish to set permanently the swappiness at 40; I added the line: vm.swappiness=40
to the file /etc/sysctl.conf:

[alain4@mag6 ~]$ cat /etc/sysctl.conf
net.ipv4.icmp_ignore_bogus_error_responses=1
net.ipv4.icmp_echo_ignore_broadcasts=0
net.ipv4.icmp_echo_ignore_all=0
net.ipv4.conf.all.rp_filter=1
net.ipv4.conf.all.log_martians=1
vm.swappiness=40

but after the boot:
[alain4@mag6 ~]$ cat /proc/sys/vm/swappiness 
60

of course, it's always possible to set the swappiness at 40 during the session,but this change doesn't remain at the following boot







Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.
Comment 1 peter lawford 2021-06-30 14:39:44 CEST
solved: I have added the line vm.swappiness=40
to the file /etc/sysctl.d/51-drakx.conf:
[alain4@mag6 ~]$ cat /etc/sysctl.d/51-drakx.conf 
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
net.ipv4.conf.all.rp_filter=1
vm.swappiness=40

after reboot
[alain4@mag6 ~]$ sysctl vm.swappiness 
vm.swappiness = 40
Comment 2 Aurelien Oudelet 2021-06-30 14:45:35 CEST
Sure?
Closing.

CC: (none) => ouaurelien
Resolution: (none) => FIXED
Status: NEW => RESOLVED

Comment 3 peter lawford 2021-06-30 15:09:57 CEST
(In reply to Aurelien Oudelet from comment #2)
> Sure?
> Closing.

I've found the trick in https://forums.mageia.org/en/viewtopic.php?f=7&t=13452
Comment 4 Dave Hodgins 2021-06-30 19:18:36 CEST
Based on http://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-linux-feels-slow-and-how-to-fix-that
and my own testing, I recommend also setting the threshold ...

# cat /etc/sysctl.d/tales.conf 
# Reduce applications being swapped to disk
vm.swappiness=1
# Don't shrink the inode cache
vm.vfs_cache_pressure=50

This is on a system with 16GB ram, opera 12.16, firefox, and ktorrent all running
under kde/plasma ...
# free -m
              total        used        free      shared  buff/cache   available
Mem:          16020        4475         182         251       11362       10962
Swap:         32761           4       32756

CC: (none) => davidwhodgins

Comment 5 peter lawford 2021-06-30 23:14:16 CEST
(In reply to Dave Hodgins from comment #4)
> Based on
> http://rudd-o.com/linux-and-free-software/tales-from-responsivenessland-why-
> linux-feels-slow-and-how-to-fix-that
> and my own testing, I recommend also setting the threshold ...
> 
> # cat /etc/sysctl.d/tales.conf 
> # Reduce applications being swapped to disk
> vm.swappiness=1
> # Don't shrink the inode cache
> vm.vfs_cache_pressure=50
> 
> This is on a system with 16GB ram, opera 12.16, firefox, and ktorrent all
> running
> under kde/plasma ...
> # free -m
>               total        used        free      shared  buff/cache  
> available
> Mem:          16020        4475         182         251       11362      
> 10962
> Swap:         32761           4       32756

sorry, /etc/sysctl.d doesn't content the file tales.conf
[alain4@mag6 ~]$ ls /etc/sysctl.d
50-libreswan.conf  51-alt-sysrq.conf  51-drakx.conf
Comment 6 Dave Hodgins 2021-07-01 00:13:30 CEST
For now, create the file manually.

Long term I recommend the installer or another Mageia tool be changed to check
for systems with more 4GB or more of ram and add the file if that's the case.
 
Reopening and assigning to the Mageia tools group for consideration of the
change for cauldron.

Assignee: bugsquad => mageiatools
Status: RESOLVED => REOPENED
Resolution: FIXED => (none)
Version: 8 => Cauldron

Comment 7 Dave Hodgins 2021-07-01 00:18:17 CEST
Thinking about it more, perhaps it should not be done for no gui servers where
overall performance is more important than responsiveness.
Dave Hodgins 2021-07-01 02:10:47 CEST

Summary: impossibility to set permanently the swappiness at one another value than 60 => Default vm.swappiness and vm.vfs_cache_pressure settings result in poor responsiveness on larger ram desktop systems

Comment 8 peter lawford 2021-07-01 16:12:32 CEST
(In reply to Dave Hodgins from comment #6)
> For now, create the file manually.
no need, writing the line "vm.swappiness=40" in /etc/sysctl.d/51-drakx.conf fine works: at every boot, the swappiness is set to 40 (value I've choosed)
in fact, I think that choosing any file in /etc/sysctl.d will work
> 
> Long term I recommend the installer or another Mageia tool be changed to
> check
> for systems with more 4GB or more of ram and add the file if that's the case.
>  
> Reopening and assigning to the Mageia tools group for consideration of the
> change for cauldron.
Comment 9 peter lawford 2021-07-01 16:33:36 CEST
(In reply to Dave Hodgins from comment #6)
> For now, create the file manually.
see bug 25212
> 
> Long term I recommend the installer or another Mageia tool be changed to
> check
> for systems with more 4GB or more of ram and add the file if that's the case.
>  
> Reopening and assigning to the Mageia tools group for consideration of the
> change for cauldron.
Comment 10 Thomas Backlund 2021-07-01 18:39:26 CEST
(In reply to peter lawford from comment #8)
> (In reply to Dave Hodgins from comment #6)
> > For now, create the file manually.
> no need, writing the line "vm.swappiness=40" in /etc/sysctl.d/51-drakx.conf

dont do that... 
if drakx writes anything to that file, it might get overwritten.

> fine works: at every boot, the swappiness is set to 40 (value I've choosed)
> in fact, I think that choosing any file in /etc/sysctl.d will work

This is what you should do (create your own file)

Any file ending in *.conf will be parsed...

the number in the beginning is just to allow ordering, so take care if some parameter is in several files, the last one wins
Comment 11 peter lawford 2021-07-01 19:25:23 CEST
(In reply to Thomas Backlund from comment #10)
> (In reply to peter lawford from comment #8)
> > (In reply to Dave Hodgins from comment #6)
> > > For now, create the file manually.
> > no need, writing the line "vm.swappiness=40" in /etc/sysctl.d/51-drakx.conf
> 
> dont do that... 
> if drakx writes anything to that file, it might get overwritten.
> 
> > fine works: at every boot, the swappiness is set to 40 (value I've choosed)
> > in fact, I think that choosing any file in /etc/sysctl.d will work
> 
> This is what you should do (create your own file)
> 
> Any file ending in *.conf will be parsed...
> 
> the number in the beginning is just to allow ordering, so take care if some
> parameter is in several files, the last one wins

you're right, I have run:
[alain4@magaux ~]$ echo "vm.swappiness=40" > /etc/sysctl.d/50-swappiness.conf
(this command has created the file /etc/sysctl.d/50-swappiness.conf) and erased the corresponding line in /etc/sysctl.d/51-drakx.conf
after a reboot, I have seen it works

Note You need to log in before you can comment on or make changes to this bug.