KVM IO导致高系统负荷,WD Caviar Green(EACS)

我有Ubuntu 12.04主机运行Linux 3.2.0-24-generic,libvirt 0.9.8-2ubuntu17,qemu-kvm 1.0 + noroms-0ubuntu13。 主持人使用电梯=截止时间,客人使用电梯= noop。 所有KVM guest虚拟机都使用virtio,no caching,io mode default和LVM逻辑卷作为存储。 我使用bonnie ++ 1.96来评估IO性能。

硬件:

  • Supermicro X8SIL-F
  • Intel(R)Core(TM)i7 CPU 870
  • 4个金士顿4GiB DIMM DDR3同步1333 MHz(0.8 ns)
  • 2 x WDC WD10EACS-00D(WD Caviar Green) 我使用wdidle3工具禁用了硬盘上的IntelliPark(8秒睡眠定时器)。

硬盘分区如下:

  • 20 GB,用于主机根文件系统的md RAID-1
  • 640 GB,采用md RAID-1,具有来宾文件系统的LVM
  • 330 GB,采用md RAID-0,具有来宾文件系统的LVM
  • 4 GB,交换主机

Fdisk输出:

# fdisk -b 4096 /dev/sda Note: sector size is 4096 (not 512) Command (m for help): p Disk /dev/sda: 1000.2 GB, 1000204886016 bytes 255 heads, 63 sectors/track, 15200 cylinders, total 244190646 sectors Units = sectors of 1 * 4096 = 4096 bytes Sector size (logical/physical): 4096 bytes / 4096 bytes I/O size (minimum/optimal): 512 bytes / 512 bytes Disk identifier: 0x00000000 Device Boot Start End Blocks Id System /dev/sda1 * 2048 39070000 156271812 fd Linux raid autodetect /dev/sda2 39070080 1297361280 738197508 fd Linux raid autodetect /dev/sda3 1297361288 1945712472 2593404740 fd Linux raid autodetect /dev/sda4 1945712480 1953525160 31250724 82 Linux swap / Solaris 

观察:

  • 当我在主机上运行Bonnie ++时,在一个MD-RAID-1支持的文件系统上,在“智能写入”期间,系统负载增加到约12,所有系统(主机和客户机)变得无法使用缓慢。

输出:

 Version 1.96 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP hostname 2G 1132 91 21439 1 21741 2 5131 86 +++++ +++ 1747 8 Latency 10093us 459ms 128us 3928us 113us 83us Version 1.96 ------Sequential Create------ --------Random Create-------- hostname -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 23851 19 +++++ +++ 28728 17 28138 21 +++++ +++ 31239 19 Latency 1017us 602us 1144us 323us 61us 1196us 
  • 当我在guest虚拟机上运行bonnie ++时,在md RAID-1支持的文件系统上,在“智能写入”期间,主机系统负载增加到约25,所有系统(主机和guest虚拟机)变得无法使用。

输出:

 Version 1.96 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP hostname 2G 965 88 9244 0 7981 1 2595 74 54185 4 248.4 4 Latency 16439us 13832ms 4195ms 126ms 280ms 236ms Version 1.96 ------Sequential Create------ --------Random Create-------- hostname -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 4433 5 +++++ +++ 8005 4 8373 8 +++++ +++ 7325 4 Latency 101ms 1003us 494us 298us 64us 419us 
  • 当我在guest虚拟机上运行bonnie ++时,在一个MD-RAID-0支持的文件系统上,在“智能写入”期间,主机系统负载上升到50,所有系统(主机和客户机)变得不能使用速度慢。

输出:

 Version 1.96 ------Sequential Output------ --Sequential Input- --Random- Concurrency 1 -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks-- Machine Size K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP hostname 2G 1019 93 16786 2 12406 2 1747 30 39973 2 659.2 6 Latency 18226us 7968ms 2617ms 445ms 212ms 1613ms Version 1.96 ------Sequential Create------ --------Random Create-------- hostname -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete-- files /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP /sec %CP 16 +++++ +++ +++++ +++ +++++ +++ +++++ +++ +++++ +++ 16709 14 Latency 28112us 440us 442us 166us 96us 123us 

问题:

  • 运行Bonnie ++时,这种高负荷是否正常?
  • 我觉得IO主机和客人真的很慢,你会根据结果来确认,还是我太期待了?
  • 什么可能是这种行为的原因? (只有鱼子酱绿色的磁盘,因为你可以阅读所有的互联网?)
  • 有什么我可以调整,以提高IO速度/负载?
  • 有没有办法在单个客人中“隔离”高IO的结果,这样单个客人不会显着影响其他客人的performance?

这听起来像4k块alignment问题。 你用fdisk的-b选项吗?