PostgreSQL pgbench

This is a simple benchmark of PostgreSQL using pgbench.

To run this test with the Phoronix Test Suite, the basic command is: phoronix-test-suite benchmark pgbench.

Project Site

postgresql.org

Test Created

6 December 2010

Last Updated

24 September 2020

Test Maintainer

Michael Larabel

Test Type

System

Average Install Time

1 Minute, 25 Seconds

Average Run Time

5 Minutes, 37 Seconds

Accolades

250k+ Downloads + 5k+ Public Benchmark Results

Supported Platforms


Public Result UploadsTest Completions*Reported Installs*OpenBenchmarking.orgEventsPostgreSQL pgbench Popularity Statisticspts/pgbench2011.012011.052011.092012.012012.052012.092013.012013.052013.092014.012014.052014.092015.012015.052015.092016.012016.052016.092017.012017.052017.092018.012018.052018.092019.012019.052019.092020.012020.052020.092021.0130K60K90K120K150K
* Data based on those opting to upload their test results to OpenBenchmarking.org and users enabling the opt-in anonymous statistics reporting while running benchmarks from an Internet-connected platform.
Data current as of Fri, 22 Jan 2021 16:14:42 GMT.
100023.4%10036.6%140.0%Scaling Factor Option PopularityOpenBenchmarking.org
126.2%25021.4%10024.4%5028.0%Clients Option PopularityOpenBenchmarking.org
Read Write51.4%Read Only48.6%Mode Option PopularityOpenBenchmarking.org

Revision History

pts/pgbench-1.10.1   [View Source]   Thu, 24 Sep 2020 14:41:34 GMT
Settings tweak for the 1.10.0 changes.

pts/pgbench-1.10.0   [View Source]   Thu, 24 Sep 2020 12:11:09 GMT
Update against PostgreSQL 13.0 upstream, restructure test option handling.

pts/pgbench-1.9.1   [View Source]   Fri, 04 Oct 2019 06:53:32 GMT
Fix heavy contentiob by going off physical CPU cores.

pts/pgbench-1.9.0   [View Source]   Thu, 03 Oct 2019 09:57:40 GMT
Update against PostgreSQL 12.0. NOTE: still waiting on official Windows postgresql 12 release binaries.

pts/pgbench-1.8.7   [View Source]   Fri, 29 Mar 2019 03:20:12 GMT
Update download URLs.

pts/pgbench-1.8.6   [View Source]   Fri, 07 Dec 2018 12:47:49 GMT
Enable BSD build support.

pts/pgbench-1.8.5   [View Source]   Fri, 07 Sep 2018 09:43:34 GMT
Add bc as an external dependency.

pts/pgbench-1.8.4   [View Source]   Sun, 25 Mar 2018 13:10:40 GMT
Fix the bundled patch allowing PostgreSQL to run as root.

pts/pgbench-1.8.3   [View Source]   Thu, 22 Mar 2018 18:07:18 GMT
Adjust run count as was bumped lower during debugging.

pts/pgbench-1.8.2   [View Source]   Thu, 22 Mar 2018 18:06:30 GMT
Create db directory on Windows otherwise the test seems to sometimes fail, also add note about MSVCR120.dll needing to be on system for PostgreSQL to work.

pts/pgbench-1.8.1   [View Source]   Thu, 01 Mar 2018 11:46:17 GMT
Tidy up the Windows support, appears to be good to go.

pts/pgbench-1.8.0   [View Source]   Thu, 01 Mar 2018 11:26:11 GMT
Update against upstream PostgreSQL 10.3, add initial Windows bits.

pts/pgbench-1.7.0   [View Source]   Sat, 14 Oct 2017 15:23:03 GMT
Updating against postgresql 10.0

pts/pgbench-1.6.0   [View Source]   Fri, 19 May 2017 11:57:32 GMT
Update against upstream PostgreSQL 9.6.3.

pts/pgbench-1.5.2   [View Source]   Thu, 08 Oct 2015 16:05:08 GMT
Update download links, advertise BSD compatibility.

pts/pgbench-1.5.1   [View Source]   Tue, 09 Jun 2015 21:16:09 GMT
Hack up pgbench to let it run as root

pts/pgbench-1.5.0   [View Source]   Tue, 09 Jun 2015 20:05:58 GMT
Major update/overhaul of pgbench PostgreSQL benchmark.

pts/pgbench-1.4.0   [View Source]   Wed, 11 Apr 2012 10:15:04 GMT
Move back to older PostgreSQL 8.4.11 upstream server version to work around PostgreSQL 9.x issue right now dealing with the plpg

pts/pgbench-1.3.0   [View Source]   Sat, 27 Aug 2011 16:23:30 GMT
Update PostgreSQL to version 9.0.4.

pts/pgbench-1.2.0   [View Source]   Mon, 06 Dec 2010 15:16:36 GMT
Initial import into OpenBenchmarking.org

Suites Using This Test

C/C++ Compiler Tests

Database Test Suite

Multi-Core

Common Kernel Benchmarks

Server

CPU Massive


Performance Metrics

Analyze Test Configuration:

PostgreSQL pgbench 13.0

Scaling Factor: 1 - Clients: 1 - Mode: Read Write

OpenBenchmarking.org metrics for this test profile configuration based on 325 public results since 24 September 2020 with the latest data as of 20 January 2021.

Below is an overview of the generalized performance for components where there is sufficient statistically significant data based upon user-uploaded results. It is important to keep in mind particularly in the Linux/open-source space there can be vastly different OS configurations, with this overview intended to offer just general guidance as to the performance expectations.

Component
Percentile Rank
# Matching Public Results
TPS (Average)
96th
6
3696 +/- 114
96th
9
3687 +/- 147
96th
9
3655 +/- 131
Mid-Tier
75th
< 3406
69th
9
3236 +/- 913
54th
3
2012 +/- 19
53rd
3
1933 +/- 90
52nd
3
1744 +/- 318
Median
50th
1602
49th
4
1477 +/- 208
49th
6
1426 +/- 342
44th
3
1036 +/- 177
37th
3
918 +/- 5
33rd
3
870 +/- 85
32nd
3
825 +/- 44
32nd
4
825 +/- 51
28th
3
704 +/- 17
Low-Tier
25th
< 601
23rd
3
509 +/- 11
21st
8
489 +/- 26
19th
6
442 +/- 19
12th
3
302 +/- 2
6th
10
162 +/- 20
OpenBenchmarking.orgDistribution Of Public Results - Scaling Factor: 1 - Clients: 1 - Mode: Read Write325 Results Range From 40 To 3925 TPS4011819627435243050858666474282089897610541132121012881366144415221600167817561834191219902068214622242302238024582536261426922770284829263004308231603238331633943472355036283706378438623940714212835

Based on OpenBenchmarking.org data, the selected test / test configuration (PostgreSQL pgbench 13.0 - Scaling Factor: 1 - Clients: 1 - Mode: Read Write) has an average run-time of 3 minutes. By default this test profile is set to run at least 3 times but may increase if the standard deviation exceeds pre-defined defaults or other calculations deem additional runs necessary for greater statistical accuracy of the result.

OpenBenchmarking.orgMinutesTime Required To Complete BenchmarkScaling Factor: 1 - Clients: 1 - Mode: Read WriteRun-Time3691215Min: 1 / Avg: 2.13 / Max: 8

Based on public OpenBenchmarking.org results, the selected test / test configuration has an average standard deviation of 2%.

OpenBenchmarking.orgPercent, Fewer Is BetterAverage Deviation Between RunsScaling Factor: 1 - Clients: 1 - Mode: Read WriteDeviation510152025Min: 0 / Avg: 2.01 / Max: 18

Recent Test Results

OpenBenchmarking.org Results Compare

1 System - 6 Benchmark Results

Intel Core i5-2410M - Acer JE50_HR - Intel 2nd Generation Core DRAM

Debian 10 - 4.19.0-6-amd64 - Xfce 4.14

1 System - 466 Benchmark Results

2 x AMD EPYC 7F72 24-Core - Supermicro H11DSi-NT v2.00 - AMD Starship

Ubuntu 20.10 - 5.10.9-051009-generic - GNOME Shell 3.38.1

5 Systems - 3 Benchmark Results

Intel Pentium G3258 - Gigabyte H81M-DS2V - 8GB

FreeBSD - 12.2-RELEASE-p2 - Clang 10.0.1

2 Systems - 3 Benchmark Results

Intel Core i7-4770K - ASRock Z97 Killer - Intel 4th Gen Core DRAM

Ubuntu 18.04 - 5.5.7-050507-generic - X Server 1.20.8

1 System - 6 Benchmark Results

ARMv7 Cortex-A53 - BCM2835 Raspberry Pi 3 Model B Rev 1.2 - 925MB

Raspbian 10 - 5.4.51-v7+ - LXDE

1 System - 6 Benchmark Results

Intel Core i5 450M - Acer TravelMate 8372 - Intel Core DRAM

Debian 10 - 5.8.0-3-amd64 - Xfce 4.14

1 System - 16 Benchmark Results

2 x Intel Xeon E5-2609 0 - Cisco UCSC-C220-M3S - Intel Xeon E5

Debian 10 - 4.19.0-13-amd64 - GCC 8.3.0

1 System - 15 Benchmark Results

2 x Intel Xeon E5-2609 0 - Cisco UCSC-C220-M3S - Intel Xeon E5

Debian 10 - 4.19.0-13-amd64 - GCC 8.3.0

1 System - 14 Benchmark Results

2 x Intel Xeon E5-2609 0 - Cisco UCSC-C220-M3S - Intel Xeon E5

Debian 10 - 4.19.0-13-amd64 - GCC 8.3.0

1 System - 12 Benchmark Results

2 x Intel Xeon E5-2609 0 - Cisco UCSC-C220-M3S - Intel Xeon E5

Debian 10 - 4.19.0-13-amd64 - GCC 8.3.0

3 Systems - 25 Benchmark Results

2 x Intel Core - QEMU Standard PC - Intel 440FX 82441FX PMC

Ubuntu 20.04 - 5.4.0-52-generic - GCC 9.3.0

2 Systems - 35 Benchmark Results

4 x AMD Opteron 62xx class - QEMU Standard PC - Intel 440FX 82441FX PMC

Ubuntu 20.04 - 5.4.0-52-generic - GCC 9.3.0

Most Popular Test Results

OpenBenchmarking.org Results Compare

3 Systems - 131 Benchmark Results

Intel Core i5-10600K - ASUS PRIME Z490M-PLUS - Intel Comet Lake PCH

Ubuntu 20.04 - 5.9.0-050900daily20201012-generic - GNOME Shell 3.36.4

3 Systems - 41 Benchmark Results

Intel Xeon E3-1231 v3 - Gigabyte H81M-S1 - Intel Xeon E3-1200 v3 DRAM

Debian 10 - 4.19.0-11-amd64 - X Server 1.20.4

3 Systems - 119 Benchmark Results

Intel Core i9-7980XE - ASUS PRIME X299-A - Intel Sky Lake-E DMI3 Registers

Ubuntu 20.04 - 5.8.14-050814-generic - GNOME Shell 3.36.4

3 Systems - 208 Benchmark Results

Intel Xeon E3-1260L v5 - ASRock E3V5 WS - Intel Xeon E3-1200 v5

Ubuntu 20.10 - 5.8.0-20-generic - GNOME Shell 3.38.0

3 Systems - 114 Benchmark Results

AMD Ryzen 7 1800X Eight-Core - MSI X370 XPOWER GAMING TITANIUM - AMD 17h

Ubuntu 20.10 - 5.8.0-21-generic - GNOME Shell 3.38.0

3 Systems - 147 Benchmark Results

AMD Ryzen 7 3800XT 8-Core - ASRock X570 Pro4 - AMD Starship

Ubuntu 20.04 - 5.9.0-050900rc7daily20201003-generic - GNOME Shell 3.36.4

3 Systems - 98 Benchmark Results

Intel Xeon E3-1280 v5 - MSI Z170A SLI PLUS - Intel Xeon E3-1200 v5

Ubuntu 20.04 - 5.9.0-050900rc2daily20200826-generic - GNOME Shell 3.36.4

Find More Test Results

OpenBenchmarking.org Community User Comments

Centos 5.6 notes, workarounds

Do not install this benchmark when running as root. The automated postgres database setup will silently error out, as it insists on being a non-root user. You can install Phoronix as root, but switch to another user to run the "/usr/bin/phoronix-test-suite install pts/pgbench" command. You can't use the benchmark after it's "installed" as root, because the "installation" is local to the user, in ~/.phoronix-test-suite/ directory, and setup will have failed if you do it as root.

Secondly, the benchmark will fail unless you create the following file:

/etc/ld.so.conf.d/postgresql.conf

..and put in it the following line(s) (where /home/YOURUSER is the home directory of the user that you are about to run the install as:

/home/YOURUSER/.phoronix-test-suite/installed-tests/pts/pgbench-1.3.0/pg_/lib/
/home/YOURUSER/.phoronix-test-suite/installed-tests/pts/pgbench-1.3.0/pg_/lib/postgresql/

Cheers,

-Craig @ Halcyon Canada

Post by craighalcyon on 02 December 2011, 11.35.

Quick test for different filesystems.

If you'd like to isolate your I/O devices for this test, a quick way to do so is to create a new user with home directory on the FS you'd like to bench. Then su to that user and install/run the test. Postgres will be installed in ~/.phoronix-test-suite. You may even `usermod -d /tmp test` if you want to run from tmpfs and skip disk I/O altogether. Just beware that if your /tmp is tmpfs (RAM) you will lose all contents after a reboot.

This is a great test. Thanks to the developers. I use it often.

Post by boeroboy on 21 January 2014, 14.26.

Setup on Ubuntu 14

Ubuntu 14.04 comes with GCC 4.8 and the installation of this bench will silently fail. You'll get an error message that the benchmark could not be completed.
Install GCC 4.6 (sudo apt-get install gcc-4.6 g++-4.6) and set it as active (sudo update-alternatives --config gcc). After that, re-install pts/pgbench and you're good to go.

Post by ervin on 17 October 2014, 05.36.

Post A Comment