Cache type - write back / write through

mitchelp

Member
Jan 31, 2018
3
0
6
40
Australia
Hi Folks,

I have a question about what cache type everyone is using on their VMs in production. We are using standalone hardware nodes all SSD disks with hardware (Perc) RAID RAID-5. The chosen cache type for both Windows VMs and Linux VMs is write back for optimal performance.

We've found a lot of mixed opinions on the safety of using write back cache. It's said to be potentially dangerous in a power failure. Are the dangers of power failure / unclean shutdown only at hardware level or is write-back dangerous in unclean shutdowns / poweroffs at VM level too?

What is the ideal caching in our scenario to achieve an ideal performance vs safety trade off?

Thanks
Mitch
 
I suppose you already read this:

https://pve.proxmox.com/wiki/Performance_Tweaks#Disk_Cache

If you VM fails due to a crash or accidental poweroff/reset of that VM, you have to ask your vendor of the guest os, this is totally up to them. The data itself that has been passed down to be written to the virtual disks and reached the host will still be written because the host handles it. In what state that data is (consistency) is unknown, that can only the VM tell. (e.g. partial write of a database upgrade etc.).

'Write Back' is perfect, if you use the correct hardware for it. Power outages are normally not possible if you use multiple power supplies and multiple UPSs, so then it is perfectly save to use 'Write Back' caching. If you do not have multiple power supplies and at least on UPS, don't use it if you do not want to have the possibility of data loss. Does your PERC have a BBU and a write-back cache?

If your PVE hosts fails due to an OS crash or accidental poweroff/reset, you will also lose data, but that is common in any situation.
 
  • Like
Reactions: mitchelp
Thanks LnxBil, the nodes are in a data center and dual power from separate UPS's and backed up with a generator. I'm not too concerned about power failure of the nodes. The operating systems in use are Windows Server 2016, CentOS 7.4 and Ubuntu 16.04.
 
the nodes are in a data center and dual power from separate UPS's and backed up with a generator. I'm not too concerned about power failure of the nodes.

Yes, so 'write back' (not the unsafe marked one) is fine. I only set it to 'write back' for machines that require more performance/throughput and do not enable it by default. Not every virtual disk needs this performance.
 
  • Like
Reactions: sophialul

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!