Re: Excessive PostmasterIsAlive calls slow down WAL redo
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>, Heikki Linnakangas <hlinnaka@iki.fi>, pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2018-04-10T01:36:19Z
Lists: pgsql-hackers
On Tue, Apr 10, 2018 at 12:53 PM, Andres Freund <andres@anarazel.de> wrote: > I coincidentally got pinged about our current approach causing > performance problems on FreeBSD and started writing a patch. The > problem there appears to be that constantly attaching events to the read > pipe end, from multiple processes, causes significant contention inside > the kernel. Which isn't that surprising. That's distinct from the > problem netbsd/openbsd reported a while back (superflous wakeups). > > That person said he'd work on adding an equivalent of linux' > prctl(PR_SET_PDEATHSIG) to FreeBSD. Just an idea, not tested: what about a reusable WaitEventSet with zero timeout? Using the kqueue patch, that'd call kevent() which'd return immediately and tell you if any postmaster death notifications had arrive on your queue since last time you asked. It doesn't even touch the pipe, or any other kernel objects apart from your own queue IIUC. -- Thomas Munro http://www.enterprisedb.com
Commits
-
Poll postmaster less frequently in recovery.
- 57dcc2ef3320 14.0 landed
-
Use signals for postmaster death on FreeBSD.
- f98b8476cd4a 12.0 landed
-
Use signals for postmaster death on Linux.
- 9f09529952ac 12.0 landed
-
Introduce a pipe between postmaster and each backend, which can be used to
- 89fd72cbf26f 9.2.0 cited