pgbench benchmarks PostgreSQL by driving concurrent transaction workloads and reporting throughput, latency, failures, and connection time. Run it from another host so the benchmark does not compete with the database server for resources. section 6.2
Testing memory tuning without guessing
A five-minute run with 100 clients produced 1,082 TPS. Increasing shared_buffers to 12GB and work_mem to 2GB slightly reduced throughput to 1,063 TPS, showing that larger settings are not automatically faster. Raising max_connections to 1,000 caused the test to hang under load; the Linux OOM killer then terminated a PostgreSQL process. Treat pgbench results as evidence for controlled tuning, not as justification for indiscriminately increasing memory or connection limits.
