# pgbench

> pgbench is an open source, self-hosted database benchmarking tool from PostgreSQL Global Development Group, scripted in SQL.

- Canonical: https://perf.jmeter.ai/tools/pgbench/
- Official: https://www.postgresql.org/docs/current/pgbench.html
- Source: https://github.com/postgres/postgres
- Vendor: PostgreSQL Global Development Group
- Category: Database Benchmarking
- License: Open Source — Free; PostgreSQL License.
- Deployment: Self-hosted
- Status: Active
- Scripting: SQL
- Protocols: PostgreSQL, SQL
- OS support: Windows, macOS, Linux
- First released: Not recorded

- Last verified: 2026-08-12

## What it is
pgbench initializes a standard TPC-B-like schema or executes custom SQL scripts across concurrent PostgreSQL sessions. It reports transaction rate and latency for repeatable database capacity measurements.

## Choose it when
- Database throughput, transaction latency, and capacity benchmarks
- Teams that prefer open-source licensing and self-hosting options
- Groups comfortable scripting in SQL

## Look elsewhere when
- Teams unwilling to operate generators, results storage, and scaling

## Architecture
pgbench is operated as a database benchmark with SQL. Workload definitions and database sessions determine concurrency, while results focus on throughput and latency rather than browser journeys.

## Pricing
Free; PostgreSQL License.

## Compare

## FAQ
### Who is pgbench for?
pgbench is best for engineers measuring database throughput, transaction latency, and capacity. It is open source, so teams can self-host and extend it. Vendor: PostgreSQL Global Development Group. Deployment model: self-hosted. Free; PostgreSQL License. Confirm details against the official site and a short proof-of-concept in your environment.

### How does pgbench differ from BenchBase?
Compared with BenchBase, scripting centers on SQL rather than Java, XML. pgbench lists protocols PostgreSQL, SQL; BenchBase lists JDBC, SQL. Status is active versus active. Use the Test Rig to compare full specs side by side before a proof-of-concept. Confirm details against the official site and a short proof-of-concept in your environment.

### What scripting language and concurrency model does pgbench use?
pgbench uses SQL for scripting or scenario definition. Runtime model: protocol-oriented virtual users configured through the product workflow. OS support: Windows, macOS, Linux. Protocols: PostgreSQL, SQL. Match these to how your team already authors tests and which systems you must drive under load.

### What is the cloud or enterprise path for pgbench?
pgbench is a focused benchmark harness rather than a browser or enterprise load controller. Use its measured workload and reporting model to isolate database or code performance before broader system testing. As open source, commercial support or hosted siblings may exist separately. Check the official site. Pricing note: Free; PostgreSQL License.

### What are known limitations of pgbench?
pgbench limitations to weigh: self-hosted tools require you to provision, scale, and observe load generators yourself. Status: active. Always validate against your target protocols and scale with a proof-of-concept. Confirm details against the official site and a short proof-of-concept in your environment.

---
Curated by NaveenKumar Namachivayam (QAInsights) · methodology: https://perf.jmeter.ai/about/#methodology · corrections: https://github.com/QAInsights/Performance-Testing-Tools/issues/new?title=Tool%20submission%3A%20&body=Tool%20name%3A%20%0AOfficial%20URL%3A%20%0AWhat%20should%20be%20added%20or%20corrected%3F%20%0A