Re: [PATCHES] O_DIRECT for WAL writes

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp>
Cc: pgsql-hackers@postgresql.org
Date: 2005-06-21T13:23:39Z
Lists: pgsql-hackers
ITAGAKI Takahiro <itagaki.takahiro@lab.ntt.co.jp> writes:
> I tested two combinations,
>   - fsync_direct: O_DIRECT+fsync()
>   - open_direct: O_DIRECT+O_SYNC
> to compare them with O_DIRECT on my linux machine.
> The pgbench results still shows a performance win:

> scale| DBsize | open_sync | fsync=false  | O_DIRECT only| fsync_direct | open_direct
> -----+--------+-----------+--------------+--------------+--------------+---------------
>   10 |  150MB | 252.6 tps | 263.5(+ 4.3%)| 253.4(+ 0.3%)| 253.6(+ 0.4%)| 253.3(+ 0.3%)
>  100 |  1.5GB | 102.7 tps | 117.8(+14.7%)| 147.6(+43.7%)| 148.9(+45.0%)| 150.8(+46.8%)
>     60runs * pgbench -c 10 -t 1000
>     on one Pentium4, 1GB mem, 2 ATA disks, Linux 2.6.8

Unfortunately, I cannot believe these numbers --- the near equality of
fsync off and fsync on means there is something very wrong with the
measurements.  What I suspect is that your ATA drives are doing write
caching and thus the "fsyncs" are not really waiting for I/O at all.

			regards, tom lane