Add benchmark script#109
Open
drdrsh wants to merge 4 commits intopostgresml:mainfrom
Open
Conversation
levkk
reviewed
Aug 5, 2022
| 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 |
Contributor
There was a problem hiding this comment.
Gonna need more than 1000 transactions to get a meaningful result.
levkk
reviewed
Aug 5, 2022
| 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 |
Contributor
There was a problem hiding this comment.
Make sure to dump the db and recreate it. Bloat from benchmark slows it down.
Collaborator
Author
There was a problem hiding this comment.
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 file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.iniandbenchmark/pgcat/pgcat.tomlto change proxy configs used for the benchmarks