[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
AIX Versions 3.2 and 4 Performance Tuning Guide

Tuning Sequential Read Ahead

The VMM's sequential read-ahead feature, described in Sequential-Access Read Ahead, 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:


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]