Tip for Desktop Memory management, new vm tuning option

Ralf Mardorf silver.bullet at zoho.com
Tue Jul 30 16:15:38 UTC 2019


On Tue, 30 Jul 2019 17:27:01 +0200, Oliver Grawert wrote:
>Am Dienstag, den 30.07.2019, 10:34 -0400 schrieb Rashkae:
>
>> sudo echo "vm.watermark_scale_factor=500" >> /etc/sysctl.conf  
>
>nope, that wont work ... you are only sudoing the "echo" not the actual
>writing (">>") to the file ... 
>
>it should be more like:
>
>echo "vm.watermark_scale_factor=500" | sudo tee -a /etc/sysctl.conf

Yes, usage with 'sudo' is a good example, when it makes sense to pipe
stdout to 'tee'. I'm doing this to switch between
cpu frequency scaling governors 'powersave' (Intel, resp. 'nondemand'
AMD) and 'performance' via
/sys/devices/system/cpu/cpu*/cpufreq/scaling_governor, so no tool is
needed and scripts are portable between Linux distros.

However, I would be very, very careful with all those esoteric tweaks.
From changing swappiness, disabling watchdog and even changing PCI
latency by BIOS settings etc., there are a lot of esoteric hints that
more likely screw up machines, than doing anything good.

There are exceptions, for example
https://aur.archlinux.org/packages/linux-rt/#comment-702130 . Enabling
CONFIG_AUDIT seemingly could be a PITA for some usages, but due to the
spectre mitigation, it's said that disabling makes no sense anymore, let
alone that using snaps with audit disabled wouldn't make sense, too.
Assuming for the usage disabling spectre mitigations is no issue and
AppArmore isn't needed, then it could be helpful to allow faster paths.

But if default values cause machines to become unstable, then I would
consider to not change a value such as the vm.watermark_scale_factor,
but instead to report this upstream. One or the other tweak to
increase performance sometimes makes sense, but to divert from defaults
to make a machine more stable isn't reasonable. Usually it's reasonable
to increase performance at the cost of something, e.g. security and/or
reliability.






More information about the ubuntu-users mailing list