JFS Tuning and Performance

7
Read ahead with VxVM stripes
The default value for read_pref_io is 64 KB, and the default value for read_nstream is 1, except when
the file system is mounted on a VxVM striped volume where the tunables are defaulted to match the
striping attributes. For most applications, the 64 KB read ahead size is good (remember, VxFS
attempts to maintain 4 segments of read ahead size). Depending on the stripe size (column width)
and number of stripes (columns), the default tunables on a VxVM volume may result in excessive read
ahead and lead to performance problems.
Consider a VxVM volume with a stripe size of 1 MB and 20 stripes. By default, read_pref_io is set to
1 MB and read_nstream is set to 20. When VxFS initiates the read ahead, it tries to prefetch 4
segments of the initial read ahead size (4 segments * read_pref_io). But as the sequential reads
continue, the read ahead size can grow to 20 MB (read_pref_io * read_nstream), and VxFS attempts
to maintain 4 segments of read ahead data, or 80 MB. This large amount of read ahead can flood
the SCSI I/O queues or internal disk array queues, causing severe performance degradation.
Note
If you are using VxVM striped volumes, be sure to review the
read_pref_io and read_nstream values to be sure excessive read
ahead is not being done.
False sequential I/O patterns and read ahead
Some applications trigger read ahead when it is not needed. This behavior occurs when the
application is doing random I/O by positioning the file pointer using the lseek() system call, then
performing the read() system call, or by simply using the pread() system call.
Figure 2. False sequential I/O patterns and read ahead
If the application reads two adjacent blocks of data, the read ahead algorithm is triggered. Although
only 2 reads are needed, VxFS begins prefetching data from the file, up to 4 segments of the read
ahead size. The larger the read ahead size, the more data read into the buffer/file cache. Not only is
excessive I/O performed, but useful data that may have been in the buffer/file cache is invalidated so
the new unwanted data can be stored.
Note
If the false sequential I/O patterns cause performance problems, read
ahead can be disabled by setting read_ahead to 0 using vxtunefs(1M), or
direct I/O could be used.
Enhanced read ahead
Enhanced read ahead can detect non-sequential patterns, such as reading every third record or
reading a file backwards. Enhanced read ahead can also handle patterns from multiple threads. For
8K
8K
8K
lseek()/read()/read()
lseek()/read()