What is the I/O performance difference when lvm is created on a disk or partition?

https://access.redhat.com/solutions/2946061

 SOLUTION 已验证 - 已更新 2017年五月30日14:27 - 

English 

环境

  • 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?

诊断步骤

Raw

# 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
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值