ZFS sync=disabled safeness

decibel83

Active Member
Oct 15, 2008
187
1
38
Hi,

is it safe to set the ZFS sync as disabled on Proxmox 6 if I have a working UPS protection?
I see that fsyncs increases a lot with sync disabled, will this corrupt some snapshot?

Thanks!
 

fabian

Proxmox Staff Member
Staff member
Jan 7, 2016
5,508
908
163
power loss is not the only thing that can cause your system to drop dead. I'd only set sync to disabled if you don't care about losing the last few X of writes, where X depends on your work load.
 

guletz

Famous Member
Apr 19, 2017
1,458
226
83
Brasov, Romania
Hi dB's ;)

Sync disable in the worst case scenario -> you will lose the data that are in the zfs chace(5 sec by default). But not only power
will be a problem that could result in a data lose(UPS will avoid this), but it could also be a kernel crash(in this cache UPS will not help)
 

decibel83

Active Member
Oct 15, 2008
187
1
38
power loss is not the only thing that can cause your system to drop dead. I'd only set sync to disabled if you don't care about losing the last few X of writes, where X depends on your work load.

Thanks.
Could you help me to understand which are the possible events which causes last writes to be lost?
  • Power interruption without UPS
  • Hard shutdown
  • Kernel crash on Proxmox host
  • Kernel crash on virtual machine?
  • Qm process or container kill from Proxmox host?
  • Snapshot?
  • Other?
Are snapshots safe with sync=disabled?
 
Because I'm getting 10x fsyncs with sync disabled, and virtual machine are much much more faster.

well, disabling sync makes all io asynchronous - regardless the protocol.
I don't know what the default value of tgx commits are but this timeframe you will basically loose on data.
depending on the application this can/will result in inconsistent data and for instance linux will probably run into recovery mode so that you fix it with fsck. with databases you will have different problems then.

rather then disabling it completely you should investigate why it is so slow
I guess you don't have a SLOG do you ?
 

LnxBil

Famous Member
Feb 21, 2015
5,482
607
133
Germany
No, I don't have a SLOG, do I need it even using SSD and NVMe drives?

A simple enterprise level SSD with e.g. 32 GB is totally sufficient for this and will increase your throughput tremendously.

Thanks.
Could you help me to understand which are the possible events which causes last writes to be lost?
  • Power interruption without UPS
  • Hard shutdown
  • Kernel crash on Proxmox host
  • Kernel crash on virtual machine?
  • Qm process or container kill from Proxmox host?
  • Snapshot?
  • Other?
Are snapshots safe with sync=disabled?

The qm process kill thing does not apply, but everything else will. If you create a snapshot and press the reset button, you could have a corrupt snapshot if it has been written/registred at all. Your overall likelihood of data loss is increased in general
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE 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 your own in 60 seconds.

Buy now!