linux – 在LVM上更改哪个调度程序以使虚拟机受益

前端之家收集整理的这篇文章主要介绍了linux – 在LVM上更改哪个调度程序以使虚拟机受益前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
当您拥有LVM时,您在/ sys / block中有一个用于物理卷的调度程序条目,但也包含每个逻辑卷和原始设备的条目.

我们有一个运行Xen hypervisor 4.0(3Ware 9650 SE硬件RAID1)的Debian 6 LTS x64内核2.6.32系统.在每个逻辑卷上运行虚拟机时,如果要影响操作系统的调度方式,您需要在哪个虚拟机上设置调度程序?如果您将逻辑卷设置为截止日期,那么当物理卷设置为cfq时,它是否会执行任何操作?如果你确定它在逻辑卷上设置截止日期,那么即使磁盘因为设置为cfq的其他LV上的IO而变慢,这些截止日期也会得到尊重吗?

问题涉及虚拟机上的IO过多地降低其他虚拟机的速度.所有客人都在内部使用noop作为调度程序.

编辑:根据this,在多路径环境中,只有DM的调度程序才会生效.因此,如果我想以截止日期的方式处理虚拟机之间的IO,我必须将物理卷的DM路径(在我的情况下为dm-1)设置为截止日期.是对的吗?还有一个sdc调度程序,它是我的dm-1的原始块设备.为什么不应该这样做呢?

edit2:但是有人在评论中说dm-0/1在新内核中没有调度程序:

  1. famzah@VBox:~$cat /sys/block/dm-0/queue/scheduler
  2. none

在我的系统(Debian 6,内核2.6.32)上,我有:

  1. cat /sys/block/dm-1/queue/scheduler
  2. noop anticipatory [deadline] cfq

问题也是,我有多路径设置吗? pvs显示

  1. # pvs
  2. PV VG Fmt Attr PSize PFree
  3. /dev/dm-0 universe lvm2 a- 5,41t 3,98t
  4. /dev/dm-1 alternate-universe lvm2 a- 1,82t 1,18t

但它们是用/ dev / sd [bc]创建的.这是否意味着我有多路径,即使它是标准的LVM设置?

我想,主要问题是我必须在sdc或dm-1上设置调度程序吗?如果我做iostat,我看到两者都有很多访问权限:

  1. Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
  2. sdc 0,00 0,00 13,02 25,36 902,71 735,56 42,68 0,08 2,17 0,73 2,79
  3. dm-1 82,25 57,26 12,97 25,31 735,72 0,18 4,73 0,84 3,23

那么,什么是什么,谁是老板?如果它是sdc,我可以告诉你,将其设置为截止日期并不会影响我的VM的性能.看看’请求合并’列(前两个)中的差异,我会说它是控制调度的dm-1.

解决方法

嗯,Debian ……

好吧,我可以分享Redhat如何通过他们的tuned framework解决这个问题.有“虚拟主机”和“虚拟客户”的配置文件. profile descriptions are explained in detail here和以下摘录显示了哪些设备受到影响. “dm- *”和“sdX”设备的调度程序已更改.

  1. # This is the I/O scheduler ktune will use. This will *not* override anything
  2. # explicitly set on the kernel command line,nor will it change the scheduler
  3. # for any block device that is using a non-default scheduler when ktune starts.
  4. # You should probably leave this on "deadline",but "as","cfq",and "noop" are
  5. # also legal values. Comment this out to prevent ktune from changing I/O
  6. # scheduler settings.
  7. ELEVATOR="deadline"
  8.  
  9. # These are the devices,that should be tuned with the ELEVATOR
  10. ELEVATOR_TUNE_DEVS="/sys/block/{sd,cciss,dm-,vd,zd}*/queue/scheduler"

另见:CentOS Tuned Equivalent For DebianUnderstanding RedHat’s recommended tuned profiles

猜你在找的Linux相关文章