18.07.2013 Views

HP-UX VxFS tuning and performance - filibeto.org

HP-UX VxFS tuning and performance - filibeto.org

HP-UX VxFS tuning and performance - filibeto.org

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Note<br />

The OnlineJFS license is required to perform direct I/O when using <strong>VxFS</strong><br />

5.0 or earlier. Beginning with <strong>VxFS</strong> 5.0.1, direct I/O is available with the<br />

Base JFS product.<br />

Discovered direct I/O<br />

With <strong>HP</strong> OnLineJFS, direct I/O will be enabled if the read or write size is greater than or equal to the<br />

file system tunable discovered_direct_iosz. The default discovered_direct_iosz is 256 KB. As with<br />

direct I/O, all discovered direct I/O will be synchronous. Read ahead <strong>and</strong> flush behind will not be<br />

performed with discovered direct I/O.<br />

If read ahead <strong>and</strong> flush behind is desired for large reads <strong>and</strong> writes or the data needs to be reused<br />

from buffer/file cache, then the discovered_direct_iosz can be increased as needed.<br />

Direct I/O <strong>and</strong> unaligned data<br />

When performing Direct I/O, alignment is very important. Direct I/O requests that are not properly<br />

aligned have the unaligned portions of the request managed through the buffer or file cache.<br />

For writes, the unaligned portions must be read from disk into the cache first, <strong>and</strong> then the data in the<br />

cache is modified <strong>and</strong> written out to disk. This read-before-write behavior can dramatically increase<br />

the times for the write requests.<br />

Note<br />

The best direct I/O <strong>performance</strong> occurs when the logical requests are<br />

properly aligned. Prior to <strong>VxFS</strong> 5.0 on 11i v3, the logical requests need to<br />

be aligned on file system block boundaries. Beginning with <strong>VxFS</strong> 5.0 on<br />

11i v3, logical requests need to be aligned on a device block boundary (1<br />

KB).<br />

Direct I/O on <strong>HP</strong>-<strong>UX</strong> 11.23<br />

Unaligned data is still buffered using 8 KB buffers (default size), although the I/O is still done<br />

synchronously. For all <strong>VxFS</strong> versions on <strong>HP</strong>-<strong>UX</strong> 11i v2 <strong>and</strong> earlier, direct I/O performs well when the<br />

request is aligned on a file system block boundary <strong>and</strong> the entire request can by-pass the buffer<br />

cache. However, requests smaller than the file system block size or requests that do not align on a file<br />

system block boundary will use the buffer cache for the unaligned portions of the request.<br />

For large transfers greater than the block size, part of the data can still be transferred using direct<br />

I/O. For example, consider a 16 KB write request on a file system using an 8 KB block where the<br />

request does not start on a file system block boundary (the data starts on a 4 KB boundary in this<br />

case). Since the first 4 KB is unaligned, the data must be buffered. Thus an 8 KB buffer is allocated,<br />

<strong>and</strong> the entire 8 KB of data is read in, thus 4 KB of unnecessary data is read in. This behavior is<br />

repeated for the last 4 KB of data, since it is also not properly aligned. The two 8 KB buffers are<br />

modified <strong>and</strong> written to the disk along with the 8 KB direct I/O for the aligned portion of the request.<br />

In all, the operation took 5 synchronous physical I/Os, 2 reads <strong>and</strong> 3 writes. If the file system is recreated<br />

to use a 4 KB block size or smaller, the I/O would be aligned <strong>and</strong> could be performed in a<br />

single 16 KB physical I/O.<br />

13

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

Saved successfully!

Ooh no, something went wrong!