|
Softpanorama |
May the source be with you, but remember the KISS principle ;-)
Softpanorama Search
|
| Enterprise Unix System Administration | Recommended Links | Network Performance tuning | |||||
| Performance Monitoring | Linux Performance Tuning | Solaris Performance Tuning | AIX performance tuning | NFS performance tuning | Oracle Performance Tuning | Database Performance Tuning | Tivoli Performance Tuning |
| uptime command | free | top | ps | pmap | ptree | sar | |
| mostat | vmstat | iostat | procstat | nfsstat | Humor | Etc |
Lectures
Articles - Kernel Tuningvm.swappiness is a tunable kernel parameter that controls how much the kernel favors swap over RAM. At the source code level, it's also defined as the tendency to steal mapped memory. A high swappiness value means that the kernel will be more apt to unmap mapped pages. A low swappiness value means the opposite, the kernel will be less apt to unmap mapped pages. In other words, the higher the vm.swappiness value, the more the system will swap.
The default value I've seen on both enterprise level Red Hat and SLES servers is 60.
To find out what the default value is on a particular server, run:
sysctl vm.swappiness
The value is also located in /proc/sys/vm/swappiness.
What reason might there be to change the value of this parameter? Like all other tunable kernel parameters, there may not be a compelling reason to change the default value, but having a facility that allows one to manipulate how the linux kernel behaves without modifying source code is indispensable.
If there were reasons to change the vm.swappiness kernel parameter, one might be to decrease the parameter if swapping is undesirable. I've seen enterprise configurations where servers had a swap to RAM ratio of 1:125. It's evident in this case that there is no interest in ever using anything but physical memory so why not make the kernel privy to this information. Whether the vm.swappiness parameter is set to 0, 20, 40, or any other value, the owner of the server should perform due diligence to see what affect this has on the server and applications. For an under-the-cover look on the effect of changing the parameter, one only needs to look at the vmscan.c source file and the swap_tendency algorithm.
swap tendency = mapped_ratio / 2 + distress + vm_swappiness;
On the flip side, one may consider increasing the vm.swappiness parameter greater than the default if a particular system has physical memory contraints."Systems with memory constraints that run batch jobs (processes that sleep for long time) might benefit from an aggressive swapping behavior." http://unixfoo.blogspot.com/2007/11/linux-performance-tuning.html
Andrew Morton sets his workstation vm.swappiness parameter to 100. "My point is that decreasing the tendency of the kernel to swap stuff out is wrong. You really don't want hundreds of megabytes of BloatyApp's untouched memory floating about in the machine. Get it out on the disk, use the memory for something useful."
The following is an excerpt of a benchmark obtained using different vm.swappiness values while performing dd on a 2.6.5-7.97-default kernel (http://lwn.net/Articles/100978/):
vm.swappiness Total I/O Avg Swap 0 273.57 MB/s 0 MB 20 273.75 MB/s 0 MB 40 273.52 MB/s 0 MB 60 229.01 MB/s 23068 MB 80 195.63 MB/s 25587 MB 100 184.30 MB/s 26006 MB To read more information on the vm.swappiness kernel tunable, you may find these links helpful.
About:
Sysprof is a sampling CPU profiler that uses a Linux kernel module to profile the entire system, not just a single application. It handles shared libraries, and applications do not need to be recompiled. It profiles all running processes, not just a single application, has a nice graphical interface, shows the time spent in each branch of the call tree, can load and save profiles, and is easy to use.Release focus: Minor bugfixes
Changes:
This version compiles with recent kernels.Author:
Søren Sandmann [contact developer]
Copyright © 1996-2009 by Dr. Nikolai Bezroukov. www.softpanorama.org was created as a service to the UN Sustainable Development Networking Programme (SDNP) in the author free time. Submit comments This document is an industrial compilation designed and created exclusively for educational use and is placed under the copyright of the Open Content License(OPL). Site uses AdSense so you need to be aware of Google privacy policy. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.
Disclaimer:
Created May 16, 1996; Last modified: October 19, 2009