[pve-devel] Fwd: Re: recommanded cache setting for rbd image

Alexandre DERUMIER aderumier at odiso.com
Wed Nov 7 08:27:09 CET 2012


>>But O_DIRECT does not give you any safety (just tries to minimize cache effects). 
>>So there is no real difference regarding safety. 

>>The NOTES about O_DIRECT in "man 2 open" are not really useful. 

yes, O_DIRECT is just bypassing the host cache. I never thinked that cache=none is safer than cache=writeback.


For me, we should have same write performance with cache=none or cache=writeback.
but with writeback we need to flush from guest + host. (overhead ?).

Maybe some block driver like rbd can benefit from writeback on host, as they can aggregate writes from differents guest, and flush them once ?
Maybe same for iscsi devices, the host scheduler can reorder writes from differents guest and flush them once ?


I'll so some benchs today, cache=none vs cache=writeback, with netapp nfs,nexenta iscsi and local sas drives with raid controller with write cache.


----- Mail original ----- 

De: "Dietmar Maurer" <dietmar at proxmox.com> 
À: "Dietmar Maurer" <dietmar at proxmox.com>, "Alexandre DERUMIER" <aderumier at odiso.com> 
Cc: pve-devel at pve.proxmox.com 
Envoyé: Mercredi 7 Novembre 2012 07:30:39 
Objet: RE: [pve-devel] Fwd: Re: recommanded cache setting for rbd image 

> > So maybe if we set cache=none and that guest doesn't support flushes 
> > (drivers,kernel,?), it become writethrough in guest, so it's safe ? 

I am looking at the source code now. Cache modes results in the following open flags: 

cache=node ==> BDRV_O_NOCACHE | BDRV_O_CACHE_WB ==> O_DIRECT 
cache=writeback ==>BDRV_O_CACHE_WB ==> no flags 

So the only difference is that we open the file with O_DIRECT. 

But O_DIRECT does not give you any safety (just tries to minimize cache effects). 
So there is no real difference regarding safety. 

The NOTES about O_DIRECT in "man 2 open" are not really useful. 



More information about the pve-devel mailing list