Udgivet i

Linux swap og swappiness

Fra Manjaro forum har jeg denne perle.

I actually think this should depend on the amount of RAM. In my experience, I achieve very satisfactory results with the rounded up value 100*128/(1024*x), being “x” the amount of GB of RAM the machine has. This drastically reduces swap usage, keeping at least 128MB of free RAM (in practice it always keeps more, I deduce it is because of the kernel policy on defining the blocks of data moved to the swap). So, at my desktop (8GB) I have vm.swappiness=2, in my laptop (2GB) vm.swappiness=7 and in an old laptop I have set up recently (512MB) I have vm.swappiness=25. The value 128MB should also depend on the kind of software mainly used. I found this value to be a sane choice for a general purpose system. Might be lower if most processes demand much less RAM or high if the demand is usually high (the aim is to always have free RAM to avoid swapping before a process loads, while reducing unnecessary swaps – that’s what makes Windows slow under heavy load, they make heavy use of disk paging thinking it makes the system faster, but it actually hogs the system).

Kilde forum.manjaro.org/t/make-kde-faster/21284/22