Created
December 28, 2017 22:24
-
-
Save mdcallag/0843d07f83938108e180f0f0bcbda1fe to your computer and use it in GitHub Desktop.
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
nuser=$1 | |
only1table=$2 | |
nrows=$3 | |
dbuser=$4 | |
dbpass=$5 | |
dbname=$6 | |
seed=$( date +%s ) | |
if [[ $only1table != "yes" ]]; then | |
echo $nuser users and $nuser tables | |
for nu in $( seq 1 $nuser ); do | |
python iibench.py --db_name=$dbname --rows_per_report=100000 --db_host=127.0.0.1 --db_user=$dbuser --db_password=$dbpass --engine=innodb --unique_checks=1 --bulk_load=0 --max_rows=$nrows --table_name=pi${nu} --setup --num_secondary_indexes=3 --data_length_min=10 --data_length_max=20 --rows_per_commit=100 --inserts_per_second=0 --query_threads=0 --seed=$(( $seed + $nu )) >& o.ib.no.$nu & | |
pids[${nu}]=$! | |
done | |
for nu in $( seq 1 $nuser ) ; do | |
echo wait for user $nu with pid ${pids[${nu}]} | |
wait ${pids[${nu}]} | |
done | |
else | |
echo $nuser users and 1 table | |
python iibench.py --db_name=$dbname --rows_per_report=100000 --db_host=127.0.0.1 --db_user=$dbuser --db_password=$dbpass --engine=innodb --unique_checks=1 --bulk_load=0 --max_rows=$nrows --table_name=pi1 --setup --num_secondary_indexes=3 --data_length_min=10 --data_length_max=20 --rows_per_commit=100 --inserts_per_second=0 --query_threads=0 --seed=$(( $seed + 1 )) >& o.ib.yes.1 & | |
pids[1]=$! | |
sleep 5 | |
for nu in $( seq 2 $nuser ); do | |
python iibench.py --db_name=$dbname --rows_per_report=100000 --db_host=127.0.0.1 --db_user=$dbuser --db_password=$dbpass --engine=innodb --unique_checks=1 --bulk_load=0 --max_rows=$nrows --table_name=pi1 --num_secondary_indexes=3 --data_length_min=10 --data_length_max=20 --rows_per_commit=100 --inserts_per_second=0 --query_threads=0 --seed=$(( $seed + $nu )) >& o.ib.yes.$nu & | |
pids[${nu}]=$! | |
done | |
for nu in $( seq 1 $nuser ) ; do | |
echo wait for user $nu with pid ${pids[${nu}]} | |
wait ${pids[${nu}]} | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment