I thought that it was true, but after reading some answers in this thread now I have doubts.
The real reason why I want to know it's because of the
So, turning
Thanks for your time.
The real reason why I want to know it's because of the
full_page_writes
parameter in postgresql DB. Setting it to off improves the performance greatly (almost x2) but for non COW FS keeps the DB in a unsafe state if sudden crash or power loss happens. So, as ZFS it's a COW FS it's recommended to set it to off in every guide in how to tune PG for ZFS. For example:Consider the Postgres full_page_writes parameter. Tomas Vondra has written about it in the past as a necessity to prevent WAL corruption due to partial writes. The WAL is both streaming replication and crash recovery, so its integrity is of utmost importance. As a result, this is one parameter almost everyone should leave alone.
ZFS is Copy on Write (CoW). As a result, it’s not possible to have a torn page because a page can’t be partially written without reverting to the previous copy. This means we can actually turn off full_page_writes in the Postgres config. The results are some fairly startling performance gains:
$> pgbench -j 32 -c 32 -M prepared -T 10 pgbench
...
tps = 10325.200812 (including connections establishing)
tps = 10336.807218 (excluding connections establishing)
That’s nearly a 70% improvement. Due to write amplification caused by full page writes, Postgres produced 1.2GB of WAL files during a 1-minute pgbench test, but only 160MB with full page writes disabled.
To be fair, a 32-thread pgbench write test is extremely abusive and certainly not a typical usage scenario. However, ZFS just ensured our storage a much lower write load by altering one single parameter. That means the capabilities of the hardware have also been extended to higher write workloads as IO bandwidth is not being consumed by WAL traffic.
So, turning
full_page_writes
off inside of an EXT4 ZVOL would make PG unsafe as in an EXT4 FS, or safe like running directly on a ZFS FS?Thanks for your time.