This document discusses the vmtune command used to modify the VMM parameters that control the behavior of the memory management subsystem. This information applies to AIX Versions 4.x.
The AIX and RS/6000 product documentation library is also available:
http://www.rs6000.ibm.com/resource/
The command and source for vmtune are found in the /usr/samples/kernel directory. It is installed with the bos.adt.samples fileset.
There may be times when the default VMM parameters prove unsatisfactory. For instance, consider the situation where the aggregate size of the working pages is very large and file system pages are only referenced infrequently. In this case, the pages from the file system are read once and never used again. With the default parameters, the system would try to maintain up to ((RAMSIZE-4MB)*.8), or approximately 80%, of real memory with persistent pages, leaving only ((RAMSIZE-4MB)*.2), approximately 20%, for working pages. This imbalance would cause more working pages than necessary to be paged to and from paging space.
In this example you can choose to reduce the maxperm value to 65% in an attempt to maintain a larger set of working pages in memory. This setting could lead to less paging to page space with no detrimental effect on the persistent storage. That will decrease, though, as the system brings in working pages and replaces some file pages.
If you find that your system frequently requires quick access to many frames from the free list, you may want to increase the minfree and maxfree values. A larger minfree ensures that more frames are readily available when they are needed. The delta between minfree and maxfree determines how many pages are to be stolen for each call to the page replacement code (PRC). A larger delta usually means longer intervals between calls to the PRC, but each call takes longer to complete.
You can achieve significant differences in read times by using various minpgahead and maxpgahead values. It is very dependent upon disk activity and access to the individual files. The VMM read ahead algorithms, which these values affect, are designed to improve sequential access read performance.
It takes experience and know-how to set vmtune parameters properly. Therefore, it is highly recommended that you set vmtune values only after consulting the AIX Performance Team. To reach them, contact your AIX support center and ask for a performance analysis through consult line.
Here are all of the parameters available for AIX Version 4.1.3 and later versions. Earlier versions of AIX contain some but not all of the following options:
Specifies the point below which file pages are protected from the repage algorithm. This value is a percentage of the total real-memory page frames in the system. The specified value must be greater than or equal to 1. The default value of the minperm percentage is always around 17-19% of memory.
Specifies the point above which the page stealing algorithm steals only file pages. This value is expressed as a percentage of the total real-memory page frames in the system. The specified value must be greater than or equal to 1. The default value of the maxperm percentage is always around 75-80% of memory. A pure NFS server may obtain better performance by increasing the maxperm value. A system that accesses large files (over 50-75% of the amount of RAM on the system--look at numperm to see how much memory is currently used for file mapping) may benefit by increasing the maxperm value. Maxperm can be reduced on systems with large active working storage requirements (the AVM column from vmstat compared to total real page frames) to reduce or eliminate page space I/O.
Specifies the number of pages with which sequential read ahead starts. This value can range from 0 through 4096. It should be a power of 2. The default value is 2.
Specifies the maximum number of pages to be read ahead. This value can range from 0 through 4096. It should be a power of 2 and should be greater than or equal to minpgahead. The default value is 8. Increasing this number will help large sequential read performance.
Because of other limitations in the kernel and the LVM, the maximum value should not be greater than 128. The delta between minfree and maxfree should always be equal to or greater than maxpgahead.
Specifies the minimum number of frames on the free list. This number can range from 8 to 204800. The default value depends on the amount of RAM on the system. minfree is by default the value of maxfree: 8. The value of maxfree is equal to minimum (the number of memory pages divided by 128, 128). The delta between minfree and maxfree should always be equal to or greater than maxpgahead.
Specifies the number of frames on the free list at which page stealing is to stop. This number can range from 16 to 204800 but must be greater than the number specified by the minfree parameter by at least the value of maxpgahead. The default value of maxfree is determined by this formula: maxfree=minimum (the number of memory pages divided by 128, 128). The delta between minfree and maxfree should always be equal to or greater than maxpgahead.
Specifies the maximum percentage of real memory that can be pinned. The default value is 80%. If this value is changed, the new value should ensure that at least 4MB of real memory will be left unpinned for use by the kernel. Maxpin values must be greater than 1 and less than 100. The value under maxpin is converted to a percentage at the end of the output of vmtune.
Specifies the number of free paging-space pages at which AIX begins sending the SIGDANGER signal to processes. The formula to determine the default value is:
MAX(512, 4*npskill)
See the npskill description below. The value of npswarn has to be greater than 0 and less than the total number of paging-space pages on the system.
Specifies the number of free paging-space pages at which AIX begins killing processes. The formula to determine default value of npskill in AIX Version 4 is:
MAX(64, number_of_paging_space_pages/128)
The npskill value has to be greater than 0 and less than the total number of paging-space pages on the system.
Specifies the number of 16KB clusters processed by the VMM's sequential write-behind algorithm. The default value is 1. Values can be any integer above 0. Higher number of clusters may result in larger sequential write performance on devices that support very fast writes (RAID and so on). Setting the value to a very high number like 500000 will essentially defeat the write-behind algorithm. This can be beneficial in cases such as database index creations where pages that were written to are read a short while later; write-behind could actually cause this process to take longer. One suggestion is to turn off write-behind before building indexes and then turn it back on after indexes have been built. For example, the mkpasswd command can run significantly faster when write-behind is disabled.
Specifies the number of file system bufstructs. The current default in AIX Version 4 is 93 since it is dependent on the size of the 'buf' struct. This value must be greater than 0. Increasing this value will help write performance for very large writes sizes (on devices that support very fast writes). In order to enable this value, you must unmount the file system, change the value, and then mount the system again.
Controls the number of pbufs available to the LVM device driver. Pbufs are pinned menory buffers used to hold I/O requests related to a Journaled File System. On systems where large amounts of sequential I/O occurs, this can result in I/Os bottlenecking at the LVM layer waiting for pbufs to be freed. In AIX Version 4, a single pbuf is used for each sequential I/O request regardless of the number of pages in that I/O. The maximum value is 128.
Specifies the number of LVM buffers for raw physical I/Os. The default value is 9. It may be beneficial to increase this value if you are doing large raw I/Os (that is, not going through the JFS). The possible values range between 1 and 64.
Specifies the number of pages that should be deleted in one chunk from RAM when a file is deleted. Changing this value may only be beneficial to real-time applications that delete files. By reducing the value of pd_npages, a real-time application can get better response time since few number of pages will be deleted before a process or thread is dispatched. The default value is the largest possible file size divided by the page size (currently 4096); if the largest possible file size is 2GB, then pd_npages is by default 524288.
Specifies a threshold (in 4KB pages) for random writes to accumulate in RAM before these pages are sync'ed to disk via a write-behind algorithm. This threshold is on a per-file basis. This option is only available in AIX Version 4.1.3 and later versions. The default value of maxrandwrt is 0, which disables random write-behind. By enabling random write-behind (a typical value might be 128), applications that make heavy use of random writes can get better performance due to less dependence on the sync daemon to force writes out to disk. Note that some applications may degrade their performance due to write-behind (such as database index creations). In these cases, it may be beneficial to disable write-behind before creating database indexes and then reenabling write-behind after the indexes are created.
This parameter specifies the size (in 4KB pages) of the least recently used (lru) page-replacement bucket size. This is the number of page frames which will be examined at one time for possible pageouts when a free frame is needed. A lower number will result in lower latency when looking for a free frame, but will also result in behavior that is not as much like a true lru alogorithm. The default value is 512MB and the minimum is 256MB. Tuning this option is not recommended.
The current values are displayed when vmtune is executed without any parameters. Changes to the values go into effect immediately but do not exist after you restart the system.