[openstack-dev] Questions on the virtual disk's cache type

Liu Yuan namei.unix at gmail.com
Wed Jan 23 10:09:01 UTC 2013

On 01/23/2013 05:30 PM, Daniel P. Berrange wrote:
> FYI There is a patch proposed for customization
>   https://review.openstack.org/#/c/18042/

Seems that this patch is dropped and declined?

> I should note that it is wrong to assume that enabling cache mode will
> improve the performance in general. Allowing caching in the host will
> require a non-negligable amount of host RAM to have a benefit. RAM is
> usually the most constrained resource in any virtualization environment.
> So while the cache may help performance when only one or two Vms are
> running on the host, it may well in fact hurt performance once the host
> is running enough VMs to max out RAM. So allowing caching will actually
> give you quite variable performance, while the cache=none will give you
> consistent performance regardless of host RAM utilization (underlying
> contention of the storage device may of course still impact things).

Yeah, allowing page cache in the host might not be a good idea to run
multiple VMs, but cache type in QEMU has different meaning for network
block devices. For e.g, we use 'cache type' to control client side cache
of Sheepdog cluster, which implement a object cache in the local disk
for performance boost and reducing network traffics. This doesn't
consume memory at all, just occupy the disk space where runs sheep daemon.

Simply put,
 cache=writeback # enable client side writeback cache of sheepdog
 cache=none,off,directsync # disable the client cache
 cache=writehrough # enable client side read-only cache


More information about the OpenStack-dev mailing list