Re: WAL write of full pages

From: Marty Scholes <marty(at)outputservices(dot)com>
To: Manfred Spraul <manfred(at)colorfullife(dot)com>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: WAL write of full pages
Date: 2004-03-16 16:01:39
Message-ID: 405724E3.3010902@outputservices.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

You are correct, modern drives are much faster than this, for big,
cacheable writes.

Try compiling and running the following code and watching your disk I/O.

Than, comment out the fsync(), which will make the writes cacheable.

Notice the huge difference. It is an multiple of 15 difference on my
machine.

#include <stdlib.h>
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>

int main()
{
int i;
char buf[8192];
int ld;

unlink("dump.out");
ld=open("dump.out", O_WRONLY | O_CREAT);

for (i=0; i<65536; i++) {
write(ld, buf, sizeof(buf));
fsync(ld);
}

close(ld);

return 0;
}

Manfred Spraul wrote:
> Marty Scholes wrote:
>
>>
>> 2. Put them on an actual (or mirrored actual) spindle
>> Pros:
>> * Keeps WAL and data file I/O separate
>> Cons:
>> * All of the non array drives are still slower than the array
>
>
> Are you sure this is a problem? The dbt-2 benchmarks from osdl run on an
> 8-way Intel computer with several raid arrays distributed to 40 disks.
> IIRC it generates around 1.5 MB wal logs per second - well withing the
> capability of a single drive. My laptop can write around 10 MB/sec
> (measured with dd if=/dev/zero of=fill and vmstat), fast drives should
> be above 20 MB/sec.
> How much wal data is generated by large postgres setups? Are there any
> setups that are limited by the wal logs.
>
> --
> Manfred
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-16 16:11:17 Re: Some one deleted pg_database entry how to fix it?
Previous Message Bruce Momjian 2004-03-16 15:55:27 Re: WAL write of full pages