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:27:30
Message-ID: ed88c619-da94-5e97-f267-9a1ff26ef05b@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

4 sata HD, hardware raid 10
4 core Xeon E5504
Box is Busy

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 15984.370 ops/sec 63 usecs/op
fdatasync 16100.336 ops/sec 62 usecs/op
fsync 15109.988 ops/sec 66 usecs/op
fsync_writethrough n/a
open_sync 16849.201 ops/sec 59 usecs/op

Compare file sync methods using two 8kB writes:
(in wal_sync_method preference order, except fdatasync is Linux's default)
open_datasync 8638.443 ops/sec 116 usecs/op
fdatasync 12036.359 ops/sec 83 usecs/op
fsync 11807.447 ops/sec 85 usecs/op
fsync_writethrough n/a
open_sync 8532.569 ops/sec 117 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 14205.165 ops/sec 70 usecs/op
2 * 8kB open_sync writes 8506.969 ops/sec 118 usecs/op
4 * 4kB open_sync writes 4979.092 ops/sec 201 usecs/op
8 * 2kB open_sync writes 2658.138 ops/sec 376 usecs/op
16 * 1kB open_sync writes 1343.359 ops/sec 744 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 13331.347 ops/sec 75 usecs/op
write, close, fsync 13435.198 ops/sec 74 usecs/op

Non-sync'ed 8kB writes:
write 297771.626 ops/sec 3 usecs/op

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2017-04-25 19:33:29 Re: pg_test_fsync performance
Previous Message kerneltrick 2017-04-25 19:27:24 Re: FDW table doesn't exist