pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Bruce Momjian <bruce@momjian.us>
To: Nikhil Shetty <nikhil.dba04@gmail.com>
Cc: pgsql-performance@lists.postgresql.org
Subject: Re: Recommended value for pg_test_fsync
Date: Mon, 29 Jun 2020 12:06:38 -0400
Message-ID: <20200629160638.GB17530@momjian.us> (raw)
In-Reply-To: <CAFpL5Vx8KQ4sdH5Bp=nq-uLwsr7N2rHiD+osMaMRzmRADqFVtA@mail.gmail.com>
References: <CAFpL5Vx8KQ4sdH5Bp=nq-uLwsr7N2rHiD+osMaMRzmRADqFVtA@mail.gmail.com>

On Mon, Jun 29, 2020 at 02:56:42PM +0530, Nikhil Shetty wrote:
> Hi Team,
> 
> We have a PostgreSQL 11.5.6 database running on VM. 
> RAM - 48GB
> CPU - 6 cores
> Disk - SSD on SAN
> 
> We wanted to check how the WAL disk is performing using pg_test_fsync.We ran a
> test and got around 870 ops/sec for opendatasync and fdatasync and just 430 ops
> /sec for fsync.We feel it is quite low as compared to what we get for local
> storage(2000 ops/sec for fsync).What is the recommended value for fsync ops/sec
> for PosgreSQL WAL disks on SAN ?

Well, it is the VM and SAN overhead, I guess.  open_datasync or
fdatasync both seem good.

---------------------------------------------------------------------------


> 
> Test Results:
> 
> pg_test_fsync -f /WAL/pg_wal/test -s 120
> 120 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                       877.891 ops/sec    1139 usecs/op
>         fdatasync                           880.911 ops/sec    1135 usecs/op
>         fsync                               433.456 ops/sec    2307 usecs/op
>         fsync_writethrough                              n/a
>         open_sync                           450.094 ops/sec    2222 usecs/op
> 
> Compare file sync methods using two 8kB writes:
> (in wal_sync_method preference order, except fdatasync is Linux's default)
>         open_datasync                       439.119 ops/sec    2277 usecs/op
>         fdatasync                           898.221 ops/sec    1113 usecs/op
>         fsync                               456.887 ops/sec    2189 usecs/op
>         fsync_writethrough                              n/a
>         open_sync                           229.973 ops/sec    4348 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           453.444 ops/sec    2205 usecs/op
>          2 *  8kB open_sync writes          223.142 ops/sec    4481 usecs/op
>          4 *  4kB open_sync writes          116.360 ops/sec    8594 usecs/op
>          8 *  2kB open_sync writes           55.718 ops/sec   17948 usecs/op
>         16 *  1kB open_sync writes           27.766 ops/sec   36015 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                 445.493 ops/sec    2245 usecs/op
>         write, close, fsync                 448.196 ops/sec    2231 usecs/op
> 
> Non-sync'ed 8kB writes:
>         write                            132410.061 ops/sec       8 usecs/op
> 
> 
> 
> Thanks and Regards,
> Nikhil

-- 
  Bruce Momjian  <bruce@momjian.us>        https://momjian.us
  EnterpriseDB                             https://enterprisedb.com

  The usefulness of a cup is in its emptiness, Bruce Lee






view thread (13+ messages)  latest in thread

Message-ID: <20200629160638.GB17530@momjian.us>
Permalink:  ../20200629160638.GB17530@momjian.us/
Also on:    postgresql.org/message-id/20200629160638.GB17530@momjian.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: bruce@momjian.us, nikhil.dba04@gmail.com, pgsql-performance@lists.postgresql.org
  Subject: Re: Recommended value for pg_test_fsync
  In-Reply-To: <20200629160638.GB17530@momjian.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox