Cache Pressure can help us improve the performance of our GNU Linux distribution. With Cache Pressure we will be able to optimize our RAM memory, since with this option we can modify the way in which the kernel introduces blocks of data into the main memory. Keep in mind that we can do a thousand things to configure our kernel and our system to better adapt to the team.
Apple offer hardware and softwareTherefore, the operating system is highly optimized for such hardware. On the contrary, we find that other systems such as Linux or Android distros must work in a multitude of hardware combinations for which they are not optimized, however they work correctly and sometimes even better than iOS or Mac OS X in certain specific tasks. The same thing happens with OS X when we try to install it on a PC, we will have verified that it does not go as fine as it would on a Mac machine ...
Well, on Linux we can use a multitude of options to improve performance. Its flexibility allows us to optimize it to the maximum and the options are so wide that it is difficult to list them all. We can use Swappines configurations, remove unnecessary kernel modules, do a deep kernel configuration to install it more cleanly, pull config files, etc.
One of them is the one we present here, Cache Pressure. If we make a few small changes, we will notice a performance improvement when using programs, daily operation of the system or when opening videos or multimedia content. Cache Pressure has a default value of 100, and it can be varied between 0 and 100, therefore it is the maximum figure. This means that the kernel moves more data that is not going to be used immediately. from RAM to hard disk SWAP partition.
If you have a lot of RAM, 16GB or more, you can choose to put a number close to 100 or leave the default value, but if you don't have too much (<4GB), perhaps such a high number would make the RAM too busy ... We will try with a value of 50 like this:
sudo sysctl -w vm.vfs_cache_pressure=50
So we put the value 50 with the first line and we can test if the performance has improved (opens videos, applications, etc.), if so, we make it permanent with:
sudo gedit /etc/sysctl.conf
And we edit the line adding at the end:
We save the changes and now you can check the change with:
sudo cat /proc/sys/vm/vfs_cache_pressure