NOTE: This article is now outdated and changes the values away from the defaults designed for the Garuda default setup. The steps will still work, but are not recommended.
In this config file, the vm.swappiness and vm.vfs_cache_pressure behave as follows.
Reducing vfs pressure reduces amount of caching that is reclaimed when more memory is used that is it reclaims the memory used for cache for whatever application you are using.
If you increase swappiness, less ram and more swap storage will be used. it is recommended to use less swappiness for HDDs since they significantly slow down the system when used as swap.
Recommended values:
For under 16gb ram and SSD:
swappiness:20-30
vfs pressure: 80-90(lower ram higher value)
For 16 gb and more and SSD:
swappiness: 20-30
vfs pressure: 65-75
you get the gist. more ram less swappiness. faster ssd more swappiness. more ram less vfs pressure, high cpu usage due to decompression=increase in vfs pressure.
default values garuda sets are usually good for most use cases but in case you get out of memory or high cpu usage due to vfs decompression and want to tweak them this is the guide.
I think adding this to the wiki is a good idea. it will help newbies learn how to handle their particular amount of RAM and swap. Will help avoid OOM problems which seem to be ubiquitous.
I use different computers with from 4 to 32 GB of RAM. I have always set my swapiness factor to 10 long before I started using Garuda.
If feel that is a good default for many different machines. I'm not saying that tweaking that number isn't a good thing. I simply feel that 10 is a good default value, and that changing that number is not required.
I wonder about the accuracy of this thread. Even with swappiness of 10, systems with 16gigs of ram will start swapping with only 4gigs of ram usage. That's slowing things down by swapping with 12gigs of ram still free. Swappiness of 20-30 as a recommendation surprises me. When I find my system swapping early, I change my swappiness to 2 or 3 and it clears up the problem and still swaps when needed. Some argue that less than 5 isn't recommended, to which I reply, "Yes it is... it's recommended by me." If anyone sets their swappiness to 20 or 30, watch all the swapping that will be going on slowing down your system while you still have 2 shrimploads of free ram. I personally don't like to see any swapping until I'm around 12 out of 16GB ram usage. But I don't know everything.
It is certainly not complete. In modern HW/SW there are too many parameters and too many combinations to consider. It’s mainly a per case subject, for each user and HW set.
The original author was confident (just like yourself ) to provide some sane settings.
Garuda uses zram and btrfs (COW) by default.
Arch uses zswap by default.
IMHO the real difference that needs investigating for the proper values combination to many parameters is for HDD and SSD disks, which require different approach.
Also, the users’ important applications and their requirements have a strong influence on the final magic recipe.
And the risk of data loss is an important factor. Having everything on RAM with a power supply failure, or a crash, will make decisions differ .
Thanks for this. The suggested command returns "error: No package owns /path/to/99-sysctl-garuda.conf"
I rewrote the file with my preferred settings and all seems well. (I've also backed up a copy so I can copy and and paste it all back if needed.) I'm not delighted the file can be overwritten in this fashion, especially not with such an insane swappiness value.