Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 1 | #!/bin/bash |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 2 | set -e |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 3 | |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 4 | CLIENTS=${CLIENTS:-"4 8"} |
| 5 | TRANSACTINOS_PER_CLIENT=${TRANSACTINOS_PER_CLIENT:-"1 2"} |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 6 | |
| 7 | |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 8 | sudo -u postgres createdb -O postgres pgbench |
| 9 | sudo -u postgres pgbench -i -U postgres pgbench |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 10 | |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 11 | |
| 12 | for num_clients in $CLIENTS; do |
| 13 | for trans_per_cl in $TRANSACTINOS_PER_CLIENT; do |
| 14 | tps_all='' |
| 15 | for i in 1 2 3 4 5 6 7 8 9 10; do |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 16 | echo -n "$num_clients $trans_per_cl:" |
| 17 | sudo -u postgres pgbench -c $num_clients -n -t $trans_per_cl -j 4 -r -U postgres pgbench | |
| 18 | grep "(excluding connections establishing)" | awk {'print $3'} |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 19 | done |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 20 | done |
| 21 | done |
| 22 | |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 23 | sudo -u postgres dropdb pgbench |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 24 | |
Yulia Portnova | 7ddfa73 | 2015-02-24 17:32:58 +0200 | [diff] [blame^] | 25 | exit 0 |
Yulia Portnova | 058a288 | 2015-02-20 17:59:12 +0200 | [diff] [blame] | 26 | |