Re: pg_test_fsync performance

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Karri Niemelä <kakoni(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: pg_test_fsync performance
Date: 2017-04-25 19:33:29
Message-ID: 793e448b-5d45-b3f8-80c4-4d0b23166357@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 04/25/2017 05:40 AM, Karri Niemelä wrote:
> Hi. Wondering what sort of results are people seeing on modern servers when running pg_test_fsync?
>
> Thanks,
> Karri
>

18 sata laptop hd's (some 5400, some 7200), hardware raid 10
12 core Xeon E5645

5 seconds per test
O_DIRECT supported on this platform for open_datasync and open_sync.

Compare file sync methods using one 8kB write:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 24903.540 ops/sec 40 usecs/op
fdatasync 21800.982 ops/sec 46 usecs/op
fsync 20762.443 ops/sec 48 usecs/op
fsync_writethrough n/a
open_sync 23394.041 ops/sec 43 usecs/op

Compare file sync methods using two 8kB writes:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 12301.561 ops/sec 81 usecs/op
fdatasync 17146.136 ops/sec 58 usecs/op
fsync 15853.102 ops/sec 63 usecs/op
fsync_writethrough n/a
open_sync 11182.711 ops/sec 89 usecs/op

Compare open_sync with different write sizes:
(This is designed to compare the cost of writing 16kB in different write
open_sync sizes.)
1 * 16kB open_sync write 18419.537 ops/sec 54 usecs/op
2 * 8kB open_sync writes 11215.533 ops/sec 89 usecs/op
4 * 4kB open_sync writes 6250.670 ops/sec 160 usecs/op
8 * 2kB open_sync writes 3245.170 ops/sec 308 usecs/op
16 * 1kB open_sync writes 1648.117 ops/sec 607 usecs/op

Test if fsync on non-write file descriptor is honored:
(If the times are similar, fsync() can sync data written on a different
descriptor.)
write, fsync, close 17929.396 ops/sec 56 usecs/op
write, close, fsync 17782.500 ops/sec 56 usecs/op

Non-sync'ed 8kB writes:
write 421898.978 ops/sec 2 usecs/op

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Glen Huang 2017-04-26 04:21:01 Questions regarding JSON processing
Previous Message Andy Colson 2017-04-25 19:27:30 Re: pg_test_fsync performance