Alexander Georgiev
2006-Jun-20 17:04 UTC
[CentOS] Postpone/avoid swaping while there is still free RAM.
Hi people, I got Centos 4.3 on a 1GB Pentium IV machine. The output of free ------------------- $ free total used free shared buffers cached Mem: 1026896 573848 453048 0 2988 131712 -/+ buffers/cache: 439148 587748 Swap: 1052248 137568 914680 ------------------ There is plenty of free ram, but the kernel prefers to swap unused pages to disk. And later I have to wait for them to be unswapped, the Desktop looses its promptness - annoying. In win2k and winXP there is a registry key property which prevents swapping while there is still RAM. Do you know whether I can achieve the same in linux? Best regards! alex
Jim Perrin
2006-Jun-20 17:47 UTC
[CentOS] Postpone/avoid swaping while there is still free RAM.
-----------------> > There is plenty of free ram, but the kernel prefers to swap unused > pages to disk. And later I have to wait for them to be unswapped, the > Desktop looses its promptness - annoying.This is a bug in the -34 and -34.0.1 kernels and possibly 1 or 2 before that. Systems under load swap prematurely. You can install the test kernel from the dev tree which will be in the upcoming 4.4 release. Your issue is fixed in that kernel. You may also want to set 'vm.swappiness = 10' or so in /etc/sysctl.conf (reread without rebooting with sysctl -p) The lower the number (0-100) you set for swappiness, the less willing your system will be to swap. No setting it to 0 will not keep your system from swapping at all.> In win2k and winXP there is a registry key property which prevents > swapping while there is still RAM. > > Do you know whether I can achieve the same in linux?-- This message has been double ROT13 encoded for security. Anyone other than the intended recipient attempting to decode this message will be in violation of the DMCA
Barry L. Kline
2006-Jun-20 17:51 UTC
[CentOS] Postpone/avoid swaping while there is still free RAM.
Alexander Georgiev wrote:> > There is plenty of free ram, but the kernel prefers to swap unused > pages to disk. And later I have to wait for them to be unswapped, the > Desktop looses its promptness - annoying. > > In win2k and winXP there is a registry key property which prevents > swapping while there is still RAM. > > Do you know whether I can achieve the same in linux?There has been a huge thread concerning this -- maybe even in this list. Use google and look for "swappiness". The place to make the change (temporarily) is: /proc/sys/vm/swappiness To make it permanent, change /etc/sysctl.conf Barry