Re: Issues with KVM

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 22/07/2011 21:59, C Anthony Risinger wrote:
> is the disk's cache mode set to none [or maybe writeback]
> (virtmanager)?

I tested various options: the most important is the cache mode.

cache=none is a little bit better than cache=default (writethrough), but there is an huge difference using cache=unsafe. This option is not supported by virt-manager, but by kvm. Using cache=unsafe, the installation of FreeBSD is ~100x faster:

 - cache=default: write at 1 to 8 KB/sec
 - cache=none: write at 40 KB/sec
 - cache=unsafe: write at 1200 KB/sec

According to agraf__ on IRC (#kvm on FreeNode), the cache mode has the following effect:

 - cache=writethrough calls fsync() after every write()
 - cache=none uses O_DIRECT
- cache=writeback calls fsync() when the guest issues a barrier() (don't use O_DIRECT)
 - cache=unsafe doesn't do any fsync() (but don't use O_DIRECT)

I still have to test writeback ;-)

I found another mail thread, of last summer (July 2010), which is exactly the same problem that I had: "BTRFS: Unbelievably slow with kvm/qemu" on this mailing list. It contains another advice:

"Make sure you build your file system with "mkfs.btrfs -m single -d single /dev/whatever". You may well be writing duplicate copies of everything."

http://lkml.org/lkml/2010/7/12/5

--

FreeBSD installation in VirtualBox is as fast (or maybe a little bit slower) than the installation in kvm using cache=unsafe. I suppose that VirtualBox uses something like cache=unsafe or cache=writeback.

Victor
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux