HP-UX VxFS tuning and performance - filibeto.org

HP-UX VxFS tuning and performance - filibeto.org HP-UX VxFS tuning and performance - filibeto.org

18.07.2013 Views

10 Figure 5. I/O throttling Flush throttling (max_diskq) The amount of dirty data being flushed per file cannot exceed the max_diskq tunable. The process performing a write() system call will skip the “flush behind” if the amount of outstanding I/O exceeds the max_diskq. However, when many buffers/pages of a file need to be flushed to disk, if the amount of outstanding I/O exceeds the max_diskq value, the process flushing the data will wait 20 milliseconds before checking to see if the amount of outstanding I/O drops below the max_diskq value. Flush throttling can severely degrade asynchronous write performance. For example, when using the default max_diskq value of 1 MB, the 1 MB of I/O may complete in 5 milliseconds, leaving the device idle for 15 milliseconds before checking to see if the outstanding I/O drops below max_diskq. For most file systems, max_diskq should be increased to a large value (such as 1 GB) especially for file systems mounted on cached disk arrays. While the default max_diskq value is 1 MB, it cannot be set lower than write_pref_io * 4. Note For best asynchronous write performance, tune max_diskq to a large value such as 1 GB. Write throttling (write_throttle) The amount of dirty data (unflushed) per file cannot exceed write_throttle. If a process tries to perform a write() operation and the amount of dirty data exceeds the write throttle amount, then the process will wait until some of the dirty data has been flushed. The default value for write_throttle is 0 (no throttling). Read flush behind VxFS introduced a new feature on 11i v3 called read flush behind. When the number of free pages in the file cache is low (which is a common occurrence) and a process is reading a file sequentially, pages which have been previously read are freed from the file cache and reused. Figure 6. Read flush behind 64K 64K 64K 64K 64K 64K Read flush behind flush behind 64K 64K 64K Sequential read 64K 64K Sequential write 64K read ahead

The read flush behind feature has the advantage of preventing a read of a large file (such as a backup, file copy, gzip, etc) from consuming large amounts of file cache. However, the disadvantage of read flush behind is that a file may not be able to reside entirely in cache. For example, if the file cache is 6 GB in size and a 100 MB file is read sequentially, the file will likely not reside entirely in cache. If the file is re-read multiple times, the data would need to be read from disk instead of the reads being satisfied from the file cache. The read flush behind feature cannot be disabled directly. However, it can be tuned indirectly by setting the VxFS flush behind size using write_pref_io and write_nstream. For example, increasing write_pref_io to 200 MB would allow the 100 MB file to be read into cache in its entirety. Flush behind would not be impacted if fcache_fb_policy is set to 0 (default), however, flush behind can be impacted if fcache_fb_policy is set to 1 or 2. The read flush behind can also impact VxFS read ahead if the VxFS read ahead size is greater than the write flush behind size. For best read ahead performance, the write_pref_io and write_nstream values should be greater than or equal to read_pref_io and read_nstream values. Note For best read ahead performance, the write_pref_io and write_nstream values should be greater than or equal to read_pref_io and read_nstream values. Buffer sizes on HP-UX 11i v2 and earlier On HP-UX 11i v2 and earlier, cached I/O is performed through the HP-UX buffer cache. The maximum size of each buffer in the cache is determined by the file system tunable max_buf_data_size (default 8k). The only other value possible is 64k. For reads and writes larger than max_buf_data_size and when performing read ahead, VxFS will chain the buffers together when sending them to the Volume Management subsystem. The Volume Management subsystem holds the buffers until VxFS sends the last buffer in the chain, then it attempts to merge the buffers together in order to perform larger and fewer physical I/Os. Figure 7. Buffer merging 8K more 8K more 8K more 8K more 8K more 8K more 8K more The maximum chain size that the operating system can use is 64 KB. Merged buffers cannot cross a “chain boundary”, which is 64 KB. This means that if the series of buffers to be merged crosses a 64 KB boundary, then the merging will be split into a maximum of 2 buffers, each less than 64 KB in size. If your application performs writes to a file or performs random reads, do not increase max_buf_data_size to 64k unless the size of the read or write is 64k or greater. Smaller writes cause the data to be read into the buffer synchronously first, then the modified portion of the data will be updated in the buffer cache, then the buffer will be flushed asynchronously. The synchronous read of the data will drastically reduce performance if the buffer is not already in the cache. For random reads, VxFS will attempt to read an entire buffer, causing more data to be read than necessary. 8K 64K 11

10<br />

Figure 5. I/O throttling<br />

Flush throttling (max_diskq)<br />

The amount of dirty data being flushed per file cannot exceed the max_diskq tunable. The process<br />

performing a write() system call will skip the “flush behind” if the amount of outst<strong>and</strong>ing I/O exceeds<br />

the max_diskq. However, when many buffers/pages of a file need to be flushed to disk, if the amount<br />

of outst<strong>and</strong>ing I/O exceeds the max_diskq value, the process flushing the data will wait 20<br />

milliseconds before checking to see if the amount of outst<strong>and</strong>ing I/O drops below the max_diskq<br />

value. Flush throttling can severely degrade asynchronous write <strong>performance</strong>. For example, when<br />

using the default max_diskq value of 1 MB, the 1 MB of I/O may complete in 5 milliseconds, leaving<br />

the device idle for 15 milliseconds before checking to see if the outst<strong>and</strong>ing I/O drops below<br />

max_diskq. For most file systems, max_diskq should be increased to a large value (such as 1 GB)<br />

especially for file systems mounted on cached disk arrays.<br />

While the default max_diskq value is 1 MB, it cannot be set lower than write_pref_io * 4.<br />

Note<br />

For best asynchronous write <strong>performance</strong>, tune max_diskq to a large value<br />

such as 1 GB.<br />

Write throttling (write_throttle)<br />

The amount of dirty data (unflushed) per file cannot exceed write_throttle. If a process tries to perform<br />

a write() operation <strong>and</strong> the amount of dirty data exceeds the write throttle amount, then the process<br />

will wait until some of the dirty data has been flushed. The default value for write_throttle is 0 (no<br />

throttling).<br />

Read flush behind<br />

<strong>VxFS</strong> introduced a new feature on 11i v3 called read flush behind. When the number of free pages<br />

in the file cache is low (which is a common occurrence) <strong>and</strong> a process is reading a file sequentially,<br />

pages which have been previously read are freed from the file cache <strong>and</strong> reused.<br />

Figure 6. Read flush behind<br />

64K<br />

64K 64K 64K<br />

64K 64K<br />

Read flush behind<br />

flush behind<br />

64K 64K 64K<br />

Sequential read<br />

64K 64K<br />

Sequential write<br />

64K<br />

read ahead

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!