Оптимизация скорости диска в виртуальной машине под KVM

Для увеличения скорости работы диска в виртуальной машине под KVM стоит поэксперементировать с кешированием и типом эмуляции. 

  <driver name='qemu' type='raw' cache='writethrough' io='native'/>

First is which I/O mechanism to use.

QEMU has two asynchronous I/O mechanisms: POSIX AIO emulation using a pool of worker threads and native Linux AIO.

Set either io='native' or io='threads' in your XML to benchmark each of these.

Second is which caching mechanism to use. You can set cache='writeback',cache='writethrough' or you can turn it off with cache='none', which you actually may find works best.

If you’re using raw volumes or partitions, it is best to avoid the cache completely, which reduces data copies and bus traffic.

Don’t use writeback unless your RAID array is battery-backed, or you risk losing data. (Of course, if losing data is OK, then feel free.)

Third, some other things that may help include turning off barriers, and using the deadline scheduler in the guest.

Finally, do some research. IBM made a very interesting presentation on KVM I/O performance at the 2010 Linux Plumbers Conference. In addition they have an extensive set of best practices on using KVM which will certainly be of interest.

P.S. Lengthy sequential reads and writes are rarely representative of a real-world workload. Try doing benchmarks with other types of workloads, ideally the actual application(s) you intend to run in production

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *