Re: [HACKERS] kqueue

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Andres Freund <andres(at)anarazel(dot)de>
Cc: Matteo Beccati <php(at)beccati(dot)com>, Mateusz Guzik <mjguzik(at)gmail(dot)com>, Keith Fiske <keith(at)omniti(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Marko Tiikkaja <marko(at)joh(dot)to>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>, Noah Misch <noah(at)leadboat(dot)com>
Subject: Re: [HACKERS] kqueue
Date: 2018-10-09 21:10:01
Message-ID: CAEepm=0N4J5oEN9kTbRnRLPUajNyidAXUxg2BswBxxk+O65Xnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Oct 2, 2018 at 6:28 AM Andres Freund <andres(at)anarazel(dot)de> wrote:
> On 2018-10-01 19:25:45 +0200, Matteo Beccati wrote:
> > On 01/10/2018 01:09, Thomas Munro wrote:
> > > I don't know why the existence of the kqueue should make recvfrom()
> > > slower on the pgbench side. That's probably something to look into
> > > off-line with some FreeBSD guru help. Degraded performance for
> > > clients on the same machine does seem to be a show stopper for this
> > > patch for now. Thanks for testing!
> >
> > Glad to be helpful!
> >
> > I've tried running pgbench from a separate VM and in fact kqueue
> > consistently takes the lead with 5-10% more tps on select/prepared pgbench
> > on NetBSD too.
> >
> > What I have observed is that sys cpu usage is ~65% (35% idle) with kqueue,
> > while unpatched master averages at 55% (45% idle): relatively speaking
> > that's almost 25% less idle cpu available for a local pgbench to do its own
> > stuff.
>
> This suggest that either the the wakeup logic between kqueue and poll,
> or the internal locking could be at issue. Is it possible that poll
> triggers a directed wakeup path, but kqueue doesn't?

I am following up with some kernel hackers. In the meantime, here is
a rebase for the new split-line configure.in, to turn cfbot green.

--
Thomas Munro
http://www.enterprisedb.com

Attachment Content-Type Size
0001-Add-kqueue-2-support-for-WaitEventSet-v12.patch application/octet-stream 16.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2018-10-09 21:27:17 Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel
Previous Message David Fetter 2018-10-09 21:08:53 Re: [HACKERS] removing abstime, reltime, tinterval.c, spi/timetravel