-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added sysbench benchmarking README.md file
- Loading branch information
1 parent
820232c
commit d8b1b1d
Showing
1 changed file
with
60 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
|
||
# Benchmarking PostgreSQL database server using sysbench client | ||
|
||
# sysbench | ||
|
||
sysbench is a scriptable multi-threaded benchmark tool based on | ||
LuaJIT. It is most frequently used for database benchmarks, but can also | ||
be used to create arbitrarily complex workloads that do not involve a | ||
database server. | ||
|
||
sysbench comes with the following bundled benchmarks: | ||
|
||
- `oltp_*.lua`: a collection of OLTP-like database benchmarks | ||
- `fileio`: a filesystem-level benchmark | ||
- `cpu`: a simple CPU benchmark | ||
- `memory`: a memory access benchmark | ||
- `threads`: a thread-based scheduler benchmark | ||
- `mutex`: a POSIX mutex benchmark | ||
|
||
# | ||
For more information on sysbench, please visit [https://github.com/akopytov/sysbench](https://github.com/akopytov/sysbench). | ||
|
||
# PostgreSQL | ||
|
||
PostgreSQL is a powerful, open source object-relational database system | ||
that uses and extends the SQL language combined with many features that | ||
safely store and scale the most complicated data workloads. | ||
|
||
# | ||
For more information on postgresql, please visit [https://www.postgresql.org/](https://www.postgresql.org/). | ||
|
||
# start the docker container with PostgreSQL server image | ||
|
||
``` shell | ||
$ docker run --name postgres-instance -e POSTGRES_PASSWORD=mypass -e POSTGRES_USER=sbtest -p 8001:5432 -d postgres-img -c min_dynamic_shared_memory=128 | ||
``` | ||
|
||
# If you need to use hugepages use following command | ||
|
||
``` shell | ||
$ docker run --name postgres-instance -e POSTGRES_PASSWORD=mypass -e POSTGRES_USER=sbtest -p 8001:5432 -d postgres-img -c huge_pages=on -c huge_page-size=2MB -c min_dynamic_shared_memory=128 | ||
``` | ||
|
||
|
||
** You can start multiple containers listening at different port number | ||
visible to the external sysbench client. | ||
|
||
# prepare data and tables | ||
|
||
``` shell | ||
$ sysbench --db-driver=pgsql --pgsql-user=sbtest --pgsql_password=mypass --pgsql-db=sbtest --pgsql-port=8001 --tables=16 --table-size=10000 --threads=256 --time=0 --events=0 --report-interval=1 --time=300 /usr/share/sysbench/oltp_read_write.lua prepare | ||
``` | ||
|
||
# Run benchmark | ||
|
||
``` shell | ||
$ sysbench --db-driver=pgsql --pgsql-user=sbtest --pgsql_password=mypass --pgsql-db=sbtest --pgsql-port=8001 --tables=16 --table-size=10000 --threads=256 --time=0 --events=0 --report-interval=1 --time=300 /usr/share/sysbench/oltp_read_write.lua run | ||
``` | ||
|
||
|