pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Michael Brown <michael.brown@discourse.org>
Cc: pgsql-general@postgresql.org
Subject: Re: fdatasync performance problem with large number of DB files
Date: Mon, 22 Feb 2021 17:43:05 -0500
Message-ID: <3612885.1614033785@sss.pgh.pa.us> (raw)
In-Reply-To: <30a67c98-243e-eef4-eec7-780fabcaa43b@discourse.org>
References: <30a67c98-243e-eef4-eec7-780fabcaa43b@discourse.org>

Michael Brown <michael.brown@discourse.org> writes:
> I presume the reason postgres doesn't blindly run a sync() is that we
> don't know what other I/O is on the system and it'd be rude to affect
> other services. That makes sense, except for our environment the work
> done by the recursive fsync is orders of magnitude more disruptive than
> a sync().

Hmm.

> * is there a knob missing we can configure?

No.  The trouble with sync() is that per POSIX, it only schedules the
writes; there's no way to tell when the work has been done.  I see
that Linux offers stronger promises in this department, but I don't
think that's very portable.  Moreover, even on Linux there's no
way to detect whether any of the writes failed.

Barring some solution to those problems, we would be unlikely to take
a patch that uses sync() instead of fsync().

			regards, tom lane





view thread (3+ messages)  latest in thread

Message-ID: <3612885.1614033785@sss.pgh.pa.us>
Permalink:  ../3612885.1614033785@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3612885.1614033785@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, michael.brown@discourse.org
  Subject: Re: fdatasync performance problem with large number of DB files
  In-Reply-To: <3612885.1614033785@sss.pgh.pa.us>
  References: <30a67c98-243e-eef4-eec7-780fabcaa43b@discourse.org> <3612885.1614033785@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox