public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andy Fan <[email protected]>
To: Andres Freund <[email protected]>
Cc: Nathan Bossart <[email protected]>
Cc: Justin Pryzby <[email protected]>
Cc: Maxim Orlov <[email protected]>
Cc: Pavel Borisov <[email protected]>
Cc: Bossart, Nathan <[email protected]>
Cc: Maxim Orlov <[email protected]>
Cc: [email protected]
Subject: Re: Pre-allocating WAL files
Date: Wed, 22 Jan 2025 01:14:22 +0000
Message-ID: <[email protected]> (raw)
In-Reply-To: <vfhyldq3rtnwd4uxbb7ro2opmvbmfswvkycavmzcqb55mmo4jk@g2d2n6xnwicb>
References: <[email protected]>
	<CALT9ZEG+R9ne6xTyEVSiLhZ7wJAQ1Jq-9XVZs=zbd_jQJyPTdA@mail.gmail.com>
	<CACG=ezb5Os_ohi1caZJLKsGJc-nSSqGXFrMjmKw4qN8fG_=NEg@mail.gmail.com>
	<[email protected]>
	<20220301150704.GA1030078@nathanxps13>
	<20220317231212.GB1415284@nathanxps13>
	<20220408203003.GA1630183@nathanxps13>
	<[email protected]>
	<Z4_C04ZJ_SymvYes@nathan>
	<Z4_Hmj2R8NXnAI-K@nathan>
	<vfhyldq3rtnwd4uxbb7ro2opmvbmfswvkycavmzcqb55mmo4jk@g2d2n6xnwicb>

Andres Freund <[email protected]> writes:

Hi,

> FWIW, I've seen the fsyncs around recycling being a rather substantial
> bottleneck. To the point of the main benefit of larger segments being the
> reduction in number of fsyncs at the end of a checkpoint.  I think we should
> be able to make the fsyncs a lot more efficient by batching them, first rename
> a bunch of files, then fsync them and the directory. The current pattern
> bascially requires a separate filesystem jouranl flush for each WAL segment.

For education purpose, how to fsync files in batch? 'man fsync' tells me
user can only fsync one file each time.

int fsync(int fd);

The fsync manual seems not saying fsync on a directory would fsync all
the files under that directory.

-- 
Best Regards
Andy Fan







view thread (17+ messages)  latest in thread

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 using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Pre-allocating WAL files
  In-Reply-To: <[email protected]>

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

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