Caching when using ZFS storage?

danb35

Renowned Member
Oct 31, 2015
84
6
73
Running Proxmox VE 4.0-57 on ZFS, and I've created local ZFS storage for my VMs, so they're using zvols for their virtual disks. How should cache be set for those? The default is no cache, but other options are write back, write through, and direct sync. I don't see a page on the wiki that addresses this, but it's possible I missed one. Any thoughts, or good resources?
 
For ZFS over iSCSI tests shows nocache is given best performance in my setup but this depends on pool config, iscsi/local, guest file system, guest OS, disk emulation, and disk controller emulation. So to be absolute sure you need to run your own tests. I can recommend fio.
 
Thanks for the info. I was kind of hoping there would be a "80+% of the time, you want X" answer, but it sounds like that isn't to be.
 
Running Proxmox VE 4.0-57 on ZFS, and I've created local ZFS storage for my VMs, so they're using zvols for their virtual disks. How should cache be set for those? The default is no cache, but other options are write back, write through, and direct sync. I don't see a page on the wiki that addresses this, but it's possible I missed one. Any thoughts, or good resources?

If you are using local ZFS then ZFS already to caching in ARC and L2ARC.
 
Thanks. I'm familiar with ARC and L2ARC (the latter of which I don't have on my system, at least at this time), but those are read caches, and the options seem to deal with write cache.
 
True, but the example in the wiki is when a file is being used as a virtual disk. In that case, using no cache will give an error, since ZFS doesn't support the O_DIRECT flag. But when using zvols for storage, this issue doesn't arise.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!