JFS Tuning and Performance

4
Extent allocation
When a file is initially opened for writing, VxFS is unaware of how much data the application will
write before the file is closed. The application may write 1 KB of data or 500 MB of data. The size of
the initial extent is the largest power of 2 greater than the size of the write, with a minimum extent
size of 8k. Fragmentation will limit the extent size as well.
If the current extent fills up, the extent will be extended if neighboring free space is available.
Otherwise, a new extent will be allocated that is progressively larger as long as there is available
contiguous free space.
When the file is closed by the last process that had the file opened, the last extent is trimmed to the
minimum amount needed.
Fragmentation
Two types of fragmentation can occur with VxFS. The available free space can be fragmented and
individual files may be fragmented. As files are created and removed, free space can become
fragmented due to the variable sized extent nature of the file system. For volatile file systems with a
small block size, the file system performance can degrade significantly if the fragmentation is severe.
Examples of applications that use many small files include mail servers. As free space becomes
fragmented, file allocation takes longer as smaller extents are allocated. Then, more and smaller I/Os
are necessary when the file is read or updated.
However, files can be fragmented even when there are large extents available in the free space map.
This fragmentation occurs when a file is repeatedly opened, extended, and closed. When the file is
closed, the last extent is trimmed to the minimum size needed. Later, when the file grows but there is
no contiguous free space to increase the size of the last extent, a new extent will be allocated and the
file could be closed again. This process of opening, extending, and closing a file can repeat resulting
in a large file with many small extents. When a file is fragmented, a sequential read through the file
will be seen as small random I/O to the disk drive or disk array, since the fragmented extents may be
small and reside anywhere on disk.
Static file systems that use large files built shortly after the file system is created are less prone to
fragmentation, especially if the file system block size is 8 KB. Examples are file systems that have
large database files. The large database files are often updated but rarely change in size.
File system fragmentation can be reported using the ā€œ-Eā€ option of the fsadm(1M) utility. File systems
can be defragmented or reorganized with the HP OnLineJFS product using the ā€œ-eā€ option of the
fsadm utility. Remember, performing one 8 KB I/O will be faster than performing eight 1 KB I/Os.
File systems with small block sizes are more susceptible to performance degradation due to
fragmentation than file systems with large block sizes.
File system reorganization should be done on a regular and periodic basis, where the interval
between reorganizations depends on the volatility, size and number of the files. Large file systems
with a large number of files and significant fragmentation can take an extended amount of time to
defragment. The extent reorganization is run online; however, increased disk I/O will occur when
fsadm copies data from smaller extents to larger ones.