|From:||Takashi Menjo <takashi(dot)menjou(dot)vg(at)hco(dot)ntt(dot)co(dot)jp>|
|Subject:||[PoC] Non-volatile WAL buffer|
|Views:||Raw Message | Whole Thread | Download mbox | Resend email|
I propose "non-volatile WAL buffer," a proof-of-concept new feature. It
enables WAL records to be durable without output to WAL segment files by
residing on persistent memory (PMEM) instead of DRAM. It improves database
performance by reducing copies of WAL and shortening the time of write
I attach the first patchset that can be applied to PostgreSQL 12.0 (refs/
tags/REL_12_0). Please see README.nvwal (added by the patch 0003) to use
the new feature.
PMEM  is fast, non-volatile, and byte-addressable memory installed into
DIMM slots. Such products have been already available. For example, an
NVDIMM-N is a type of PMEM module that contains both DRAM and NAND flash.
It can be accessed like a regular DRAM, but on power loss, it can save its
contents into flash area. On power restore, it performs the reverse, that
is, the contents are copied back into DRAM. PMEM also has been already
supported by major operating systems such as Linux and Windows, and new
open-source libraries such as Persistent Memory Development Kit (PMDK) .
Furthermore, several DBMSes have started to support PMEM.
It's time for PostgreSQL. PMEM is faster than a solid state disk and
naively can be used as a block storage. However, we cannot gain much
performance in that way because it is so fast that the overhead of
traditional software stacks now becomes unignorable, such as user buffers,
filesystems, and block layers. Non-volatile WAL buffer is a work to make
PostgreSQL PMEM-aware, that is, accessing directly to PMEM as a RAM to
bypass such overhead and achieve the maximum possible benefit. I believe
WAL is one of the most important modules to be redesigned for PMEM because
it has assumed slow disks such as HDDs and SSDs but PMEM is not so.
This work is inspired by "Non-volatile Memory Logging" talked in PGCon
2016  to gain more benefit from PMEM than my and Yoshimi's previous
work did . I submitted a talk proposal for PGCon in this year, and
have measured and analyzed performance of my PostgreSQL with non-volatile
WAL buffer, comparing with the original one that uses PMEM as "a faster-
than-SSD storage." I will talk about the results if accepted.
 Persistent Memory (SNIA)
 Persistent Memory Development Kit (pmem.io)
 Non-volatile Memory Logging (PGCon 2016)
 Introducing PMDK into PostgreSQL (PGCon 2018)
 Applying PMDK to WAL operations for persistent memory (pgsql-hackers)
Takashi Menjo <takashi(dot)menjou(dot)vg(at)hco(dot)ntt(dot)co(dot)jp>
NTT Software Innovation Center
|Next Message||Fujii Masao||2020-01-24 08:08:35||Re: Add pg_file_sync() to adminpack|
|Previous Message||Pavel Stehule||2020-01-24 08:02:47||Re: New feature proposal (trigger)|