Date: September 22, 2000
One of the advantages of AIX is that it requires minimal tuning. However, the AIX vmtune command can be used to tune memory to minimize the performance impact of paging. The following is a brief background and a cookbook approach to using the vmtune command.
The following cookbook procedure can reduce physical I/O's for paging on AIX systems, which can significantly improve performance under load. As performance tuning is part alchemy, always document the settings before changing. Also you should periodically review these settings, as tuning is always an iterative process.
When a computer's memory fills to capacity, the operating system attempts to free memory by moving some of it to disk. This is called "paging" and is often associated with severely degraded performance. The AIX vmtune command allows you to favor the type of memory that is paged, which can significantly improve performance when paging.
AIX divides memory into data and working segments.
Data segments are your data. Paging a data segment requires two I/O's (one to write out to disk, and one to read back in).
Working segments include executables and file system meta data. Paging a working segment requires only one I/O, or half the overhead of a data segment. The reason is that working segments are already on disk. If a working segment needs to be paged out, AIX simply free's the memory it occupies (no physical I/O).
The tuning strategy is to favor paging out working segments using the vmtune command. The vmtune "maxperm" setting specifies the percentage of memory to reserve for working segments. It has no effect if there is no memory contention, so the tuning is best done on a a system under load.
1. Use the vmstat command to determine the baseline paging activity The system is paging if the "pi/po" columns have non zero values. Here's an example of what a system that is paging might look like. (I doctored the following vmstat output from an idle system to simulate activity under the pi/po columns. Don't take any of the other columns too seriously) # vmstat 5 5 kthr memory page faults cpu ----- ----------- ------------------------ ------------ ----------- r b avm fre re pi po fr sr cy in sy cs us sy id wa 0 1 17326 13 0 0 0 0 2 0 122 72 48 58 2 0 40 0 1 17326 13 0 60 50 0 0 0 120 71 45 48 2 0 50 0 1 17326 13 0 10 20 0 0 0 121 72 48 0 2 0 30 0 1 17326 13 0 30 35 0 0 0 120 70 45 0 2 0 30 0 1 17326 13 0 40 15 0 0 0 120 71 47 0 2 0 60 2. Determine the current "maxperm" setting by running vmtune without any parameters. # /usr/samples/kernel/vmtune (lines deleted) number of valid memory pages = 16384 maxperm=48.0% of real memory maximum pinable=80.0% of real memory minperm=18.8% of real memory number of file memory pages = 5049 numperm=30.8% of real memory --- In this case, the current maxperm setting is 48% 3. Reduce the maxperm setting. (I typically reduce maxperm in increments of 5-10%. The lower the current maxperm setting, the smaller the increment. Use your best judgement. Consult IBM Support Line if necessary. ) The following command dynamically changes maxperm to 43%. The change should take effect immediately (no reboot necessary.) As you would expect, you must be root to run this command. # /usr/samples/kernel/vmtune -P 43 4. Return to Step 1 to determine whether the change has reduced paging. If not, continue tuning. The trick is to find the point where we minimize paging, but do not page out the operating system. The optimum setting is different on every system because the size of the working segments depends on the number of disks, filesystems, device drivers, the size of application binaries, etc. Therefore tuning will be an iterative process. 5. The vmtune setting reverts to default upon reboot. To preserve the setting, you must put the vmtune command in a boot file, such as /etc/rc. I generally recommend putting such customizations in /etc/rc.local, and point to rc.local in the /etc/rc file.
Bruce Spencer,
baspence@us.ibm.com
September 22, 2000