Chapter 6. Swap Space
/proc/sys/vm/swappinesskernel parameter. The default value of
/proc/sys/vm/swappinessis 60 which means that applications and programs that have not done a lot lately can be swapped out. Higher values will provide more I/O cache and lower values will wait longer to swap out idle applications.
Swappinesspercentage may be tuned using:
# echo 10 > /proc/sys/vm/swappiness
# echo vm.swappiness=10 >> /etc/sysctl.conf
free(1)command or you can check the
/proc/meminfofile. When the system uses swap space it will sometimes not decrease afterward. This saves I/O if memory is needed and pages do not have to be swapped out again when the pages are already in the swap space. However, if swap usage gets close to 80% - 100% (your threshold may be lower if you use a large swap space), then a closer look should be taken at the system, see also Section 6.2, “Checking Swap Space Size and Usage”. Depending on the size of your swap space, you may want to check swap activity with
sarif swap allocation is lower than 80%. But these numbers really depend on the size of the swap space. The
sarcommand output the number of pages swapped. This output field is an important metric. This number should be low or zero as constant page swapping should be avoided at all costs.
Table 6.1. Recommended Swap Space Requirements for 10g R2
|1 GB - 2 GB||1.5 times the size of RAM|
|2 GB - 8 GB||Equal to the size of RAM|
|Greater than 8GB||0.75 times the size of RAM|