Organizing Logical Volumes to Increase I/O Performance


About this document
The intra- and inter-physical volume allocation policies
Determine LVM configuration - performance and availability
Eliminate fragmentation of the file systems

About this document

This document describes the settings for intra- and inter-physical volume allocation policies to better organize logical volumes for increased I/O performance. It also provides information on configuring the system for highest performance or highest availability when creating logical volumes.

This document applies to AIX Version 3.2.

The intra- and inter-physical volume allocation policies

Intra-physical volume

The intra-physical volume allocation policy describes the location of the logical volume (LV) on the disk. This may be set when the LV is created with the mklv command or changed with the chlv command. The values may be CENTER, MIDDLE or EDGE. The disk is laid out as follows: ( Edge 3 Middle 3 Center 3 Middle 3 Edge )

To change the intra policy, use the chlv command as follows:

chlv -a {m c e ie im} LVname 

Logical volumes with the most active I/O should be placed in the center, while inactive ones should reside on the edges. The logical volume might be split across the different edges when allocated. Since it is assumed that the disk heads generally linger in the center of the disk, it would take equal time for the heads to move to the edges to capture data from the least active LVs. This would only impact performance if the data on the edges is read frequently or in large blocks.

Inter-physical volume

The inter-physical volume allocation policy should also be considered when organizing the LVs on the disk. This policy will determine whether an LV can be extended across multiple physical volumes (PV), or disks. To increase performance, the value should be MAXIMUM, indicating that the LV should be extended across the maximum number of PVs. This, however, will decrease the availability of the LV should any one of the PVs become unavailable. To restrict an LV to a single PV (or the minimum number of PVs which will hold the LV, use MINIMUM allocation).

To change the inter policy, use the chlv command as follows:

chlv -e {x m} LVname
where x = maximum and m = minimum allocation policy.

After the policies have been set for all logical volumes involved, the LVs may be reorganized by using the reorgvg command. This command will reorganize all physical partitions to match the allocation policies assigned to each LV. Since the system cannot always fill all of the requirements, it will put the LVs as close as possible to the positions specified. Enter:

reorgvg VGname LVname1 LVname2 ... 

VGname is the name of the volume group in which the LVs are contained, and LVname1, LVname2, etc are the names of the logical volumes to be reorganized. The order of the LVnames indicates the precedence of the organization of the LVs. The first one in the list will get the highest consideration in its allocation position. If you do not list any LVnames, then all LVs will be reorganized. In this case, the precedence will simply be determined by the order in which the LVs were originally created.

Determine LVM configuration - performance and availability

In general, whenever LVM is configured to provide better performance, the availability of the system is impacted.


To configure the system for the highest performance, follow these guidelines when creating logical volumes:

  1. Create logical volumes with only one copy (do not mirror partitions). If you select to mirror partitions, then set the following:
    Scheduling Policy                                           PARALLEL 
    Allocate each logical partition copy on a separate disk?    YES 

    The parallel-write scheduling policy starts the write operation for all the physical partitions in a logical partition at the same time. When the write operation to the physical partition that takes longest to complete finishes, the write operation returns.

    The YES in the allocation policy sets the STRICT variable in the mklv command run by SMIT. This setting ensures that no two copies of a logical volume partition will reside on the same physical volume if it can be avoided.

  2. Set Write-verify to NO
    Do not perform a follow-up read to each write for verification.

  3. Intra-policy should be set to one of the following:
    • If there is heavy I/O to the LV, set to CENTER.
    • For moderate I/O set to MIDDLE and INNER MIDDLE.
    • If there is little I/O to this LV, set to EDGE and INNER EDGE.

  4. Set Inter-policy to MAXIMUM

    This will spread each logical volume across as many physical volumes as possible, thereby allowing the work of reading or writing to a logical volume to be shared among several physical volumes.


To configure the system for the highest availability, follow these guidelines when creating logical volumes:

  1. Use 3 copies (mirror partitions twice).

  2. Set Write-verify to YES. Verify each write by performing a follow-up read.

  3. Set INTER-policy to MINIMUM. This specifies that only as many physical volumes as there are copies should be used to contain the logical volume.

  4. Set Scheduling Policy to SEQUENTIAL. This requires the write of each copy to be performed sequentially, increasing the likeliness that at least one copy completes prior to a system failure.

  5. Set Allocate each logical partition copy on a separate disk to YES. This will not allow any two copies of the same data to reside on the same disk.

Also consider the following, which may increase system availability:

  1. Include at least three physical volumes in a volume group. This will allow a quorum (majority) of PVs in the volume group to be maintained in the event that one of the PVs becomes unavailable.
  2. If partitions are being mirrored, mirror the copies onto physical volumes that are attached to separate buses, adapters and power supplies. Upon failure of one of these components, the copies may still be maintained, since they are not attached to the failing device.

Eliminate fragmentation of the file systems

To determine the physical partition fragmentation on a disk, such as hdisk0, issue the command:

lspv -l hdisk0
This command will list the logical volumes that are on that disk, the number of physical partitions from that logical volume that are on that disk, and how those physical partitions are distributed on the disk. Under DISTRIBUTION the number of physical partitions in the outer edge, outer middle, center, inner middle, and inner edge sections of the disk are listed.

To view the actual order of physical partitions on the disk, use the lspv -M hdisk0 command. The logical volumes that are on the fragmented portions of the disk will display. The numbers shown in the output are the physical partition number on the disk (physical volume) and the physical partition number on the logical volume.

If a logical volume is on fragmented portions of a disk, reorganize your disk. Place the logical volumes with the highest I/O nearest to the center of the disk.

Although it is possible to check the fragmentation of physical partitions, the fragmentation of the actual data within a file system cannot be checked. This fragmentation is caused by continual creation and removal of files. If performance has degraded over a period of time, then it is quite possible that there is fragmentation within your file system.

The only way to alleviate this type of fragmentation is to backup the file system by file name, delete the file system, recreate the file system with the mkfs command, and then restore the file system data.

[ Doc Ref: 90605201014634     Publish Date: Oct. 16, 2000     4FAX Ref: 9300 ]