We usually have to benchmark our PostgreSQL database to make sure that before we deliver our products for customers, the capability of the PostgreSQL database will be able to cover the expected traffic loads in production.
Benchmarks are super important in our initial implementation stage since we can estimate and answer questions such as the following:
- How many users can we support?
- What response time will we have at peak usage time?
- Will the storage space have enough capacity?
- Will the current hardware meet expectations?
Based on the answers that we obtain, we can adjust tuning parameters in PostgreSQL and at the same time, estimate what hardware we will need in the future.
Having said all that, one of the common ways to benchmark PostgreSQL is through two typical tools:
- pgbench, a built-in benchmarking tool of PostgreSQL
- Apache JMeter software, a tool designed to load test functional behavior and measure performance...