Benchmarking databases is a very extensive topic, and this chapter just introduces the major concepts. Having the pgbench tool bundled with the database is handy for doing smaller tests, but you need to be careful of its limitations before you rely too much on its results for your tuning efforts.
The basis for the built-in pgbench tests is outdated, and it's unlikely to match real-world performance. It can still be useful as a synthetic performance test.
You can write your own custom tests, either against the standard pgbench tables or new ones, and use the pgbench scripting capability to run those tests against multiple clients at once. Only a small number of the general database settings will impact pgbench results since its queries are so simple. Using a benchmarking tool chain that graphs transaction rate and latency, such as pgbench-tools, is vital to monitor...