LVM performance monitoring with the lvmstat command
You can use the lvmstat command to detect whether certain areas or partitions of a logical volume are accessed more frequently than others.
In order to display the statistics of these frequently accessed areas with the lvmstat command, you must enable the statistics to run on a per logical volume or volume group basis.
# lvmstat -l lvname -eTo disable the statistics for the lvmstat command for a specific logical volume, use the following command: # lvmstat -l lvname -dTo enable the statistics for the lvmstat command for all logical volumes in a volume group, use the following command: # lvmstat -v vgname -eTo disable the statistics for the lvmstat command for all logical volumes in a volume group, use the following command: # lvmstat -v vgname -d# lvmstat -l lv00 1
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
1 1 65536 32768 0 0.02
2 1 53718 26859 0 0.01
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
2 1 5420 2710 0 14263.16
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
2 1 5419 2709 0 15052.78
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
3 1 4449 2224 0 13903.12
2 1 979 489 0 3059.38
Log_part mirror# iocnt Kb_read Kb_wrtn Kbps
3 1 5424 2712 0 12914
# lvmstat -l lv00 -c 5The above command displays the statistics for the 5 partitions with the most I/O activity.If you do not specify the iterations parameter, the lvmstat command continues to produce output until you interrupt the command. Otherwise, the lvmstat command displays statistics for the number of iterations specified.
In using the lvmstat command, if you find that there are only a few partitions that are heavily used, you might want to separate these partitions over different hard disks using the lvmstat command. The migratelp command allows you to migrate individual partitions from one hard disk to another.