1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-07-22 23:21:53 +03:00

Scripts for benchmarking providers, dbms sim fast exit option.

This commit is contained in:
Teemu Ollakka
2018-05-09 12:23:44 +03:00
parent fbe51627a1
commit 90f6eb1ecf
3 changed files with 62 additions and 3 deletions

28
scripts/benchmark-provider.sh Executable file
View File

@ -0,0 +1,28 @@
#!/bin/bash -eu
set -x
PROVIDER=${PROVIDER:?"Provider library is required"}
total_transactions=$((1 << 17))
function run_benchmark()
{
servers=$1
clients=$2
transactions=$(($total_transactions/($servers*$clients)))
result_file=dbms-bench-$(basename $PROVIDER)-$servers-$clients
echo "Running benchmark for servers: $servers clients $clients"
rm -r *_data/ || :
command time -v ./src/dbms_simulator --servers=$servers --clients=$clients --transactions=$transactions --wsrep-provider="$PROVIDER" --fast-exit=1 >& $result_file
}
# for servers in 1 2 4 8 16
for servers in 16
do
# for clients in 1 2 4 8 16 32
for clients in 4 8 16 32
do
run_benchmark $servers $clients
done
done

25
scripts/benchmark-report.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash -eu
PROVIDER=${PROVIDER:?"Provider library is required"}
function report()
{
servers=$1
clients=$2
result_file=dbms-bench-$(basename $PROVIDER)-$servers-$clients
trx_per_sec=$(grep -a "Transactions per second" "$result_file" | cut -d ':' -f 2)
cpu=$(grep -a "Percent of CPU this job got" "$result_file" | cut -d ':' -f 2)
vol_ctx_switches=$(grep -a "Voluntary context switches" "$result_file" | cut -d ':' -f 2)
invol_ctx_switches=$(grep -a "Involuntary context switches" "$result_file" | cut -d ':' -f 2)
echo "$clients $cpu $trx_per_sec $vol_ctx_switches $invol_ctx_switches"
}
for servers in 1 2 4 8 16
do
echo "Servers: $servers"
for clients in 1 2 4 8 16 32
do
report $servers $clients
done
done

View File

@ -41,6 +41,7 @@ struct dbms_simulator_params
std::string wsrep_provider;
std::string wsrep_provider_options;
int debug_log_level;
int fast_exit;
dbms_simulator_params()
: n_servers(0)
, n_clients(0)
@ -48,6 +49,7 @@ struct dbms_simulator_params
, wsrep_provider()
, wsrep_provider_options()
, debug_log_level(0)
, fast_exit(0)
{ }
};
@ -599,8 +601,10 @@ void dbms_simulator::stop()
trrep::log() << "######## Stats ############";
trrep::log() << stats();
trrep::log() << "######## Stats ############";
// REMOVEME: Temporary shortcut
// exit(0);
if (params_.fast_exit)
{
exit(0);
}
for (auto& i : servers_)
{
dbms_server& server(*i.second);
@ -711,7 +715,9 @@ int main(int argc, char** argv)
("transactions", po::value<size_t>(&params.n_transactions),
"number of transactions run by a client")
("debug-log-level", po::value<int>(&params.debug_log_level),
"debug logging level: 0 - none, 1 - verbose");
"debug logging level: 0 - none, 1 - verbose")
("fast-exit", po::value<int>(&params.fast_exit),
"exit from simulation without graceful shutdown");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);