Re: Pre-allocating WAL files - Mailing list pgsql-hackers

From Andy Fan
Subject Re: Pre-allocating WAL files
Date
Msg-id 87o6zz4pld.fsf@163.com
Whole thread Raw
In response to Pre-allocating WAL files  (Andres Freund <andres@anarazel.de>)
Responses Re: Pre-allocating WAL files
Re: Pre-allocating WAL files
List pgsql-hackers
Andres Freund <andres@anarazel.de> 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




pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Some ExecSeqScan optimizations
Next
From: jian he
Date:
Subject: Re: Statistics Import and Export