Sample setup

The server used here is the same one described in the pgbench chapter. For these examples, initially a small pgbench database was created with a scale of 100 (one that easily fits into RAM), and the standard mixed test was run:

$ pgbench -i -s 100 pgbench
$ pgbench -j 4 -c 8 -T 300 pgbench  

This gave approximately 2000 transactions/second. Larger tests with lower TPS values will appear later as well.

If you're using a PostgreSQL earlier than 9.0, you'll have to leave out the -j 4 part of the preceding code to try this yourself, and with the pgbench examples shown later. Versions before 8.4 won't handle -T 300 either, and you'll have to find a number of substitute transactions to pass using -t in order to make the test last for ...

Get PostgreSQL 10 High Performance now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.