Re: [GENERAL] pg_test_fsync performance

От: Andy Colson
Тема: Re: [GENERAL] pg_test_fsync performance
Дата: ,
(см: обсуждение, исходный текст)
Ответ на: [GENERAL] pg_test_fsync performance  (Karri Niemelä)
Список: 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
         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

В списке pgsql-general по дате сообщения:

От: Andy Colson
Сообщение: Re: [GENERAL] pg_test_fsync performance
От: Glen Huang
Сообщение: [GENERAL] Questions regarding JSON processing