[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]
AIX Versions 3.2 and 4 Performance Tuning Guide
Tuning Sequential Read Ahead
The
VMM's sequential read-ahead feature, described in the "Sequential-Access Read Ahead" , section can
improve the performance of programs that access large files sequentially.
Occasions when tuning the sequential read-ahead feature
(or turning it off) will improve performance are rare. Nevertheless, the performance analyst
should understand how this feature interacts with the application and with other disk-I/O
tuning parameters. The figure
"Sequential Read Ahead Example" illustrates a typical
situation.
In this example, minpgahead is 2 and maxpgahead is 8--the defaults. The program is processing the file sequentially. Only the data references that have significance to the read-ahead mechanism are shown, designated by A through F. The sequence of steps is:
A |
The first access to the file causes the first page (page 0) of the file to be read. At this point the VMM makes no assumptions about random or sequential access. |
B |
When the program accesses the first byte of the next page (page 1), with no intervening accesses to other pages of the file, the VMM concludes that the program is accessing sequentially. It schedules minpgahead (2) additional pages (pages 2 and 3) to be read. Thus access B causes a total of 3 pages to be read. |
C |
When the program accesses the first byte of the first page that has been read ahead (page 2), the VMM doubles the page-ahead value to 4 and schedules pages 4 through 7 to be read. |
D |
When the program accesses the first byte of the first page that has been read ahead (page 4), the VMM doubles the page-ahead value to 8 and schedules pages 8 through 15 to be read. |
E |
When the program accesses the first byte of the first page that has been read ahead (page 8), the VMM determines that the page-ahead value is equal to maxpgahead and schedules pages 16 through 23 to be read. |
F |
The VMM continues reading maxpgahead pages when the program accesses the first byte of the previous group of read-ahead pages until the file ends. |
|
(If the program were to deviate from the sequential-access pattern and access a page of the file out of order, sequential read ahead would be terminated. It would be resumed with minpgahead pages if the VMM detected a resumption of sequential access by the program.) |
The minpgahead and maxpgahead values can be changed with the vmtune command. If you are contemplating changing these values, keep in mind:
- The values should be from the set: 0, 1, 2, 4, 8, 16. The use of other values may have adverse performance or functional effects.
- Values should be powers of 2 because of the doubling algorithm of the VMM.
- Values of maxpgahead greater than 16 (reads ahead of more then 64KB) exceed the capabilities of some disk device drivers.
- Higher values of maxpgahead can be used in systems where the sequential performance of striped logical volumes is of paramount importance.
- A minpgahead value of 0 effectively defeats the mechanism. This may have serious adverse consequences for performance.
- The default maxpgahead value of 8 yields the maximum possible sequential I/O performance for currently supported disk drives.
- The ramp-up of the read-ahead value from minpgahead to maxpgahead is quick enough that for most file sizes there would be no advantage to increasing minpgahead.
[ Previous |
Next |
Contents |
Glossary |
Home |
Search ]