1- $ psql -d postgres -U postgres -c "DROP DATABASE IF EXISTS test"
2-
3- # Testdatenbank mti dem Namen test_container erstellen
4- $ psql -d postgres -U postgres -c "CREATE DATABASE test"
1+ # create the test database with the name "test"
2+ psql -d postgres -U postgres -c "CREATE DATABASE test"
53
64# -i = initialize
7- # -s = scale default database value(16MB) * 50 = 800MB
5+ # -s = scale default database value(16MB) * s
86# time = measure the time for executing the command
9- # -i = 100 ~ 32min; -i = 200 ~ 62min
10- $ time pgbench -i -s 50 test -U postgres (~18min.)
11-
12- table # of rows
13- ---------------------------------
14- pgbench_branches 50
15- pgbench_tellers 500
16- pgbench_accounts 5.000 .000
7+ pgbench -i -s 50 test -U postgres
8+
9+ # from pgbench created tables
10+ #tablename number of rows
11+ --------------------------------------
12+ pgbench_branches s
13+ pgbench_tellers s*10
14+ pgbench_accounts s*100 .000
1715pgbench_history 0
1816
17+ # c = number of client connections to simulate
18+ # j = number of worker processes for pgbench
19+ # t = tps per client session => c*t
20+ pgbench -c 10 -j 2 -t 10000 test -U postgres
1921
20- # c = clients -> number of clients to connect with
21- # j = threads -> number of worker processes for pgbench
22- # t = transactions -> number of transactions per client session => 10*100.000 = 1.000.000 transactions
23- # -t 100000 -> nach 42min abgebrochen -> ram const stabil unter req; cpu const. über req
24- # -t 10000 -> number of transactions per client session => 10*10.000 = 100.000 transactions
25- $ time pgbench -c 10 -j 2 -t 10000 test -U postgres
22+ # read-only test
23+ # create the test database with the name "test_read"
24+ psql -d postgres -U postgres -c "CREATE DATABASE test_read"
2625
26+ # -S = use built in select only script
27+ pgbench -h <Standby LoadBalancer IP> -p 5432 -d -c 50 -j 10 -t 10000 -S test_read -U postgres
2728
28- # kill database with to much ressourcen
29- $ pgbench -c 90 -j 10 -t 100000 test -U postgres
29+ # kill database with heavy resource usage
30+ pgbench -c 90 -j 10 -t 100000 test -U postgres
3031
3132# get size of database
32- SELECT pg_size_pretty( pg_database_size('test ') );
33+ SELECT pg_size_pretty( pg_database_size('databasename ') );
0 commit comments