setproctitle_fast()

From: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: setproctitle_fast()
Date: 2018-07-04 22:09:09
Message-ID: CAEepm=1wKMTi81uodJ=1KbJAz5WedOg=cr8ewEXrUFeaxWEgww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers,

FreeBSD's setproctitle() is a bit slow because it contains a syscall
or two, so people often run PostgreSQL with update_process_title set
to off on that OS. That makes the user experience not quite as nice
as Linux. As a weekend learn-me-some-kernel-hacking project I fixed
that and got the patch committed to FreeBSD 12, though I was asked to
use a new libc entry point _fast(). Here's a patch to teach
PostgreSQL about that. It doesn't have much effect on small systems,
but it makes "pgbench -c 40 -j 40 -S -M prepared" do ~10% more
transactions per second on an AWS m4.10xlarge instance.

I'll park this patch here until the FreeBSD feature escapes in a
RELEASE version in a few months.

For anyone interested, https://wiki.postgresql.org/wiki/FreeBSD has
some notes on this and other such things.

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

Attachment Content-Type Size
0001-Use-setproctitle_fast-to-update-the-ps-status-if-ava.patch application/octet-stream 4.1 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2018-07-04 23:07:12 Re: Allow cancelling VACUUM of nbtrees with corrupted right links
Previous Message Tom Lane 2018-07-04 21:35:05 Re: Cache invalidation after authentication (on-the-fly role creation)