Re: [HACKERS] kqueue
Thomas Munro <thomas.munro@enterprisedb.com>
From: Thomas Munro <thomas.munro@enterprisedb.com>
To: Mateusz Guzik <mjguzik@gmail.com>
Cc: Keith Fiske <keith@omniti.com>, Matteo Beccati <php@beccati.com>,
Tom Lane <tgl@sss.pgh.pa.us>, Andres Freund <andres@anarazel.de>, Heikki Linnakangas <hlinnaka@iki.fi>,
Marko Tiikkaja <marko@joh.to>, Alvaro Herrera <alvherre@2ndquadrant.com>,
Robert Haas <robertmhaas@gmail.com>, Pg Hackers <pgsql-hackers@postgresql.org>, Noah Misch <noah@leadboat.com>
Date: 2018-09-27T22:55:13Z
Lists: pgsql-hackers
Attachments
- 0001-Add-kqueue-support-to-WaitEventSet-v10.patch (application/octet-stream) patch v10-0001
On Tue, May 22, 2018 at 12:07 PM Thomas Munro <thomas.munro@enterprisedb.com> wrote: > On Mon, May 21, 2018 at 7:27 PM, Mateusz Guzik <mjguzik@gmail.com> wrote: > > I have benchmarked the change on a FreeBSD box and found an big > > performance win once the number of clients goes beyond the number of > > hardware threads on the target machine. For smaller number of clients > > the win was very modest. > > So to summarise your results: > > 32 connections: ~445k -> ~450k = +1.2% > 64 connections: ~416k -> ~544k = +30.7% > 96 connections: ~331k -> ~508k = +53.6% I would like to commit this patch for PostgreSQL 12, based on this report. We know it helps performance on macOS developer machines and big FreeBSD servers, and it is the right kernel interface for the job on principle. Matteo Beccati reported a 5-10% performance drop on a low-end Celeron NetBSD box which we have no explanation for, and we have no reports from server-class machines on that OS -- so perhaps we (or the NetBSD port?) should consider building with WAIT_USE_POLL on NetBSD until someone can figure out what needs to be fixed there (possibly on the NetBSD side)? Here's a rebased patch, which I'm adding to the to November CF to give people time to retest, object, etc if they want to. -- Thomas Munro http://www.enterprisedb.com
Commits
-
Add kqueue(2) support to the WaitEventSet API.
- 815c2f0972c8 13.0 landed
-
Add WL_EXIT_ON_PM_DEATH pseudo-event.
- cfdf4dc4fc96 12.0 cited
-
Be conservative about alignment requirements of struct epoll_event.
- a3b30763cc86 9.6.0 cited
-
Make idle backends exit if the postmaster dies.
- ac1d7945f866 9.6.0 cited