Re: FreeBSD UFS & fsync

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: Luca Ferrari <fluca1978(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: FreeBSD UFS & fsync
Date: 2021-02-22 21:37:29
Message-ID: CA+hUKG+0DWFSZTGmezxZttXTy0YYrX=oemxiw8Gzz3hSTU64Jw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Feb 23, 2021 at 5:49 AM Luca Ferrari <fluca1978(at)gmail(dot)com> wrote:
> I'm running a virtual machine with FreeBSD 12.2, PostgreSQL 12.5 and
> UFS as filesystem.
> I was experimenting with fsync = off and pgbench, and I see no
> particular difference in tps having fsync enabled or disabled.
> Now, the same tiny test on a linux box provides a 10x tps, while on
> FreeBSD is a 1% increase.
> I'm trying to figure out why, and I suspect there is something related
> to how UFS handles writes.

Do you have WCE enabled? In that case, modern Linux file systems
would do a synchronous SYNCHRONIZE CACHE for our WAL fdatasync(), but
FreeBSD UFS wouldn't as far as I know. It does know how to do that
(there's a BIO_FLUSH operation, also used by ZFS), but as far as I can
see UFS uses it just for its own file system meta-data crash safety
currently (see softdep_synchronize()). (There is also no FUA flag for
O_[D]SYNC writes, an even more modern invention.)

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Luca Ferrari 2021-02-23 07:46:50 Re: FreeBSD UFS & fsync
Previous Message Luca Ferrari 2021-02-22 16:48:28 FreeBSD UFS & fsync