PATCH: pgbench - option to build using ppoll() for larger connection counts
Rady, Doug <radydoug@amazon.com>
From: "Rady, Doug" <radydoug@amazon.com>
To: "pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Cc: Robert Haas <robertmhaas@gmail.com>
Date: 2018-01-22T08:34:06Z
Lists: pgsql-hackers
Attachments
- pgbench11-ppoll-v6.patch (application/octet-stream) patch v6
This version of the patch attempts to address the feedback for the previous submission on 28-Nov-2017 This patch enables building pgbench to use ppoll() instead of select() to allow for more than (FD_SETSIZE - 10) connections. As implemented, when using ppoll(), the only connection limitation is system resources. “… ppoll() is to poll() as pselect() is to select(). Since the existing code uses select(), why not convert to poll() rather than ppoll()?” Time in pgbench is measured in microseconds. The select() uses microseconds. The ppoll() and pselect() call use nanoseconds The poll() call uses milliseconds. In order to not downgrade time resolution, ppoll() is used instead of poll(). Without this patch, one is limited to '(FD_SETSIZE - 10)’ number of connections. Example of something that fails without this patch but works with the patch: Without the patch: $ pgbench -j 1500 -c 1500 invalid number of clients: "1500" With the patch: $ pgbench -j 1500 -c 1500 starting vacuum...end. progress: 12.0 s, 782.3 tps, lat 917.507 ms stddev 846.929 transaction type: <builtin: TPC-B (sort of)> scaling factor: 2000 query mode: simple number of clients: 1500 number of threads: 1500 number of transactions per client: 10 number of transactions actually processed: 15000/15000 latency average = 1180.216 ms latency stddev = 855.126 ms tps = 658.674816 (including connections establishing) tps = 765.289160 (excluding connections establishing) -- Doug Rady Amazon Aurora, RDS PostgreSQL radydoug@amazon.com
Commits
-
Use ppoll(2), if available, to wait for input in pgbench.
- 60e612b60299 12.0 landed
-
Use pselect(2) not select(2), if available, to wait in postmaster's loop.
- 81069a9efc5a 10.0 cited