Re: [PoC] Non-volatile WAL buffer

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: Takashi Menjo <takashi(dot)menjou(dot)vg(at)hco(dot)ntt(dot)co(dot)jp>, "'Deng, Gang'" <gang(dot)deng(at)intel(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PoC] Non-volatile WAL buffer
Date: 2020-10-26 14:07:45
Message-ID: 3f01ba8d-306f-8d49-db98-0f4bbf8c9090@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I had a new look at this thread today, trying to figure out where we
are. I'm a bit confused.

One thing we have established: mmap()ing WAL files performs worse than
the current method, if pg_wal is not on a persistent memory device. This
is because the kernel faults in existing content of each page, even
though we're overwriting everything.

That's unfortunate. I was hoping that mmap() would be a good option even
without persistent memory hardware. I wish we could tell the kernel to
zero the pages instead of reading them from the file. Maybe clear the
file with ftruncate() before mmapping it?

That should not be problem with a real persistent memory device, however
(or when emulating it with DRAM). With DAX, the storage is memory-mapped
directly and there is no page cache, and no pre-faulting.

Because of that, I'm baffled by what the
v4-0002-Non-volatile-WAL-buffer.patch does. If I understand it
correctly, it puts the WAL buffers in a separate file, which is stored
on the NVRAM. Why? I realize that this is just a Proof of Concept, but
I'm very much not interested in anything that requires the DBA to manage
a second WAL location. Did you test the mmap() patches with persistent
memory hardware? Did you compare that with the pmem patchset, on the
same hardware? If there's a meaningful performance difference between
the two, what's causing it?

- Heikki

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Dilger 2020-10-26 14:08:12 Re: new heapcheck contrib module
Previous Message Craig Ringer 2020-10-26 14:05:10 Re: Internal key management system