-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add benchmark script #109
base: main
Are you sure you want to change the base?
Add benchmark script #109
Conversation
benchmark/run_benchmark.sh
Outdated
echo "================================================" | ||
echo "[Pgbouncer] Running test directly against the DB" | ||
echo "================================================" | ||
docker compose exec --env PGPASSWORD=main_user proxy pgbench -t 1000 -c 128 -j 2 -p 5432 -h 127.0.0.1 -U main_user -S --protocol extended shard0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gonna need more than 1000 transactions to get a meaningful result.
benchmark/run_benchmark.sh
Outdated
docker compose up -d | ||
wait_for_containers | ||
|
||
docker compose exec --env PGPASSWORD=main_user proxy pgbench -p 6432 -h 127.0.0.1 -U main_user -i shard0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make sure to dump the db and recreate it. Bloat from benchmark slows it down.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am pretty sure docker compose down -v
clears the volumes so there should be no history after it runs but I went ahead and added logic to drop the database and recreate it.
This PR adds docker-based benchmark that allows a fair performance comparison between Pgcat, Pgbouncer and Postgres baseline.
I am using the same base image for both proxies and subjecting them to the same load to be able to do apples-to-apples comparison.
You will need docker for this. To run the benchmark do
Optionally you can specify any of the following flags
You can also modify
benchmark/pgbouncer/pgbouncer.ini
andbenchmark/pgcat/pgcat.toml
to change proxy configs used for the benchmarks