Posted on 2012-03-19 16:35
Milo的海域 阅读(352)
评论(0) 编辑 收藏 所属分类:
MySQL
# parepare test database
createDB="drop database if exists $database; create database if not exists $database;"
mysql -h $vip --port=$port -uadmin -padmin -e "$createDB"
# prepare data
prepare="$sysbench --test=oltp --mysql-table-engine=innodb --oltp-table-size=$row"
prepare="$prepare --mysql-port=$port --mysql-host=$vip --mysql-db=$database"
prepare="$prepare --mysql-password=admin --mysql-user=admin prepare"
$prepare
# run sysbench
# http://sysbench.sourceforge.net/docs/#database_mode see this link for more options
run="$sysbench --test=oltp --mysql-table-engine=innodb --init-rng --oltp-table-size=$row"
run="$run --max-requests=0 --max-time=900 --num-threads=128 --oltp-test-mode=complex"
run="$run --oltp-point-selects=2 --oltp-simple-ranges=1 --oltp-sum-ranges=2"
run="$run --oltp-index-updates=10 --oltp-non-index-updates=5 --mysql-port=$port"
run="$run --mysql-db=$database --mysql-host=$vip --mysql-password=admin --mysql-user=admin"
# support oltp-user-delay-min to add delay for each sysbench request
if [[ "$lag" != "nolag" ]]
then
run="$run --oltp-user-delay-min=$lag"
fi
run="$run run"