Skip site navigation (1) Skip section navigation (2)

Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)

From: Greg Stark <gsstark(at)mit(dot)edu>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-performance(at)postgresql(dot)org, Michael Clemmons <glassresistor(at)gmail(dot)com>, Hannu Krosing <hannu(at)2ndquadrant(dot)com>, Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>
Subject: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)
Date: 2010-01-19 14:52:25
Message-ID: 407d949e1001190652i43f4f276x6a485f375647219a@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-performance
On Mon, Jan 18, 2010 at 4:35 PM, Greg Stark <gsstark(at)mit(dot)edu> wrote:
> Looking at this patch for the commitfest I have a few questions.

So I've touched this patch up a bit:

1) moved the posix_fadvise call to a new fd.c function
pg_fsync_start(fd,offset,nbytes) which initiates an fsync without
waiting on it. Currently it's only implemented with
posix_fadvise(DONT_NEED) but I want to look into using sync_file_range
in the future -- it looks like this call might be good enough for our
checkpoints.

2) advised each 64k chunk as we write it which should avoid poisoning
the cache if you do a large create database on an active system.

3) added the promised but afaict missing fsync of the directory -- i
think we should actually backpatch this.

Barring any objections shall I commit it like this?


-- 
greg


-- 
greg

Attachment: create-database-speedup-using-pfa.diff
Description: text/x-patch (4.7 KB)

In response to

Responses

pgsql-performance by date

Next:From: Greg StarkDate: 2010-01-19 14:57:14
Subject: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)
Previous:From: fkater@googlemail.comDate: 2010-01-19 13:36:30
Subject: Re: Inserting 8MB bytea: just 25% of disk perf used?

pgsql-hackers by date

Next:From: Greg StarkDate: 2010-01-19 14:57:14
Subject: Re: Faster CREATE DATABASE by delaying fsync (was 8.4.1 ubuntu karmic slow createdb)
Previous:From: Robert HaasDate: 2010-01-19 14:49:21
Subject: Re: attoptions

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group