Re: fdatasync performance problem with large number of DB files

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Michael Brown <michael(dot)brown(at)discourse(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: fdatasync performance problem with large number of DB files
Date: 2021-02-22 22:43:05
Message-ID: 3612885.1614033785@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Michael Brown <michael(dot)brown(at)discourse(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron 2021-02-22 23:45:06 Re: Simple IN vs IN values performace
Previous Message Michael Lewis 2021-02-22 22:36:46 Re: Simple IN vs IN values performace