https://access.redhat.com/solutions/2946061
SOLUTION 已验证 - 已更新 2017年五月30日14:27 -
环境
- Red Hat Enterprise Linux (RHEL)
- Logical Volume Manager(lvm2)
问题
- What is the best way to create a Logical Volume (lvm) for performance.
- What is the performance impact when lvm is created on a single disk or partition?
决议
-
Both ways are having same I/O performance and both practices are supported by
Red Hat. -
Using (one) partition on any single drive, with proper alignment, reduces administrative oversight and helps maintain acceptable performance levels.
-
It is generally recommended that you create a single partition that covers the whole disk to label as an LVM physical volume for the following reasons:
Administrative convenience
- It is easier to keep track of the hardware in a system if each real disk only appears once. This becomes particularly true if a disk fails. In addition, multiple physical volumes on a single disk may cause a kernel warning about unknown partition types at boot-up.
Striping performance
-
LVM cannot tell that two physical volumes are on the same physical disk. If you create a striped logical volume when two physical volumes are on the same physical disk, the stripes could be on different partitions on the same disk. This would result in a decrease in performance rather than an increase.
-
Please refer below articles for more information.
Physical Volumes
What are the advantages and disadvantages to using partitioning when using LVM on LUNs?
诊断步骤
# lvs -a -o +devices
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Devices
testlv testvg -wi-ao---- 100.00m /dev/vdc1(0)<=== pv created on the partition of the disk
testlv1 testvg2 -wi-ao---- 152.00m /dev/vdb(0)<===== pv created on single disk
lv_root vg_dhcp10203 -wi-ao---- 6.71g /dev/vda2(0)
lv_swap vg_dhcp10203 -wi-ao---- 816.00m /dev/vda2(1718)
/dev/mapper/testvg2-testlv1
144M 82M 55M 61% /lv2 <=====pv created on whole disk
/dev/mapper/testvg-testlv
93M 82M 6.4M 93% /lv1 <=====pv created on partition of the disk
# dd if=/dev/zero of=/lv1/test.out bs=1M count=80
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 0.224117 s, 374 MB/s
# dd if=/dev/zero of=/lv2/test.out bs=1M count=80
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 0.215269 s, 390 MB/s
# dd if=/dev/zero of=/lv1/test.out bs=1M count=80 oflag=direct
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 0.232956 s, 360 MB/s
# dd if=/dev/zero of=/lv2/test.out bs=1M count=80 oflag=direct
80+0 records in
80+0 records out
83886080 bytes (84 MB) copied, 0.230134 s, 365 MB/s

1117

被折叠的 条评论
为什么被折叠?



