Re: pgbench vs. wait events - Mailing list pgsql-hackers

From Jeff Janes
Subject Re: pgbench vs. wait events
Date
Msg-id CAMkU=1znjGg_xTSLThQJnMhZS0pWwp62T30R4-t-rHFbufvA7w@mail.gmail.com
Whole thread Raw
In response to Re: pgbench vs. wait events  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
On Fri, Oct 7, 2016 at 8:51 AM, Jeff Janes <jeff.janes@gmail.com> wrote:

I think we need to come up with some benchmarking queries which get more work done per round-trip to the database. And build them into the binary, because otherwise people won't use them as much as they should if they have to pass "-f" files around mailing lists and blog postings.   For example, we could enclose 5 statements of the TPC-B-like into a single function which takes aid, bid, tid, and delta as arguments.  And presumably we could drop the other two statements (BEGIN and COMMIT) as well, and rely on autocommit to get that job done.  So we could go from 7 statements to 1.


Here is an implementation of that.  I've included the calling code as a patch to pgbench, because if I make it a separate -f file then it is a pain to get the correct scale and settings of naccounts, etc., into it.

The create script could be integrated into pgbench -i if this is something we might want to commit.

This gives me an almost 3 fold increase in performance on a system with fsync turned off:


pgbench -b tpcb-func  -T30 -c8 -j8
tps = 24193.197877 (excluding connections establishing)

pgbench -b tpcb-like  -T30 -c8 -j8
tps = 8434.746300 (excluding connections establishing)


Cheers,

Jeff


Attachment

pgsql-hackers by date:

Previous
From: Jeff Janes
Date:
Subject: Re: pgbench vs. wait events
Next
From: Tom Lane
Date:
Subject: Re: Switch to unnamed POSIX semaphores as our preferred sema code?