From: Sean Chittenden <sean@chittenden.org>
To: Bill Moran <wmoran@potentialtech.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: The results of my PostgreSQL/filesystem performance tests
Date: Thu, 28 Aug 2003 12:31:23 -0700
Message-ID: <20030828193123.GI83317@perrin.nxad.com> (raw)
In-Reply-To: <3F4E54FB.3020408@potentialtech.com>
References: <3F4C0DC4.8070105@potentialtech.com>
<001201c36d24$3c572460$0500a8c0@MOBILE01>
<m3u182gg08.fsf@chvatal.cbbrowne.com>
<20030828161233.GB83759@perrin.nxad.com>
<3F4E54FB.3020408@potentialtech.com>
> I need to step in and do 2 things:
Thanks for posting that. Let me know if you have any questions while
doing your testing. I've found that using 16K blocks on FreeBSD
results in about an 8% speedup in writes to the database, fwiw.
I'm likely going to make this the default for PostgreSQL on FreeBSD
starting with 7.4 (just posted something to -hackers about this)f. If
you'd like to do this in your testing, just apply the following patch.
Right now PostgreSQL defaults to 8K blocks, but FreeBSD uses 16K
blocks which means that currently, reading two blocks of data in PG is
two read calls to the OS, one reads 16K of data off disk and returns
the 1st page, the 2nd call pulls the 2nd block from the FS cache. In
making things 16K, it avoids the need for the 2nd system call which is
where the performance difference is coming from, afaikt. -sc
--
Sean Chittenden
Attachments:patch (text/plain, 546B) download
Index: src/include/pg_config_manual.h
===================================================================
RCS file: /home/ncvs/pgsql/pgsql-server/src/include/pg_config_manual.h,v
retrieving revision 1.5
diff -u -r1.5 pg_config_manual.h
--- src/include/pg_config_manual.h 4 Aug 2003 00:43:29 -0000 1.5
+++ src/include/pg_config_manual.h 27 Aug 2003 17:40:12 -0000
@@ -23,7 +23,7 @@
*
* Changing BLCKSZ requires an initdb.
*/
-#define BLCKSZ 8192
+#define BLCKSZ 16384
/*
* RELSEG_SIZE is the maximum number of blocks allowed in one disk
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-performance@postgresql.org
Cc: sean@chittenden.org, wmoran@potentialtech.com
Subject: Re: The results of my PostgreSQL/filesystem performance tests
In-Reply-To: <20030828193123.GI83317@perrin.nxad.com>
References: <3F4C0DC4.8070105@potentialtech.com> <001201c36d24$3c572460$0500a8c0@MOBILE01> <m3u182gg08.fsf@chvatal.cbbrowne.com> <20030828161233.GB83759@perrin.nxad.com> <3F4E54FB.3020408@potentialtech.com> <20030828193123.GI83317@perrin.nxad.com>
* 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