[root@MySQLSlaveDB3 BenchScript]# cat ./StartSysBench.sh
#!/bin/sh
HOST=192.168.56.200
PORT=4040
USER=mysql
PASS=mysql
DB=test
SOCKET=/database/mysql/mysql.sock
ENGINE=$1
THREAD=$2
SIZE=$3
DATETIME=`date +"%Y-%m-%d %H:%M:%S"`
LOG=/download/BenchScript/output/"$HOST"_"$ENGINE".log
echo "*********************** BenchMark Information ***********************" >> $LOG
echo " IP Address : $HOST:$PORT" >> $LOG
echo " Table Type : $ENGINE" >> $LOG
echo " Table Rows : $SIZE" >> $LOG
echo " Search Thread Size : $THREAD" >> $LOG
echo " Current Time : $DATETIME" >> $LOG
echo "*********************************************************************" >> $LOG
sysbench --test=oltp \
--db-driver=mysql \
--oltp-table-size=$SIZE \
--mysql-host=$HOST \
--mysql-port=$PORT \
--mysql-user=$USER \
--mysql-password=$PASS \
--mysql-db=$DB \
--mysql-table-engine=$ENGINE \
--mysql-socket=$SOCKET \
prepare
sysbench --test=oltp \
--db-driver=mysql \
--mysql-host=$HOST \
--mysql-port=$PORT \
--mysql-user=$USER \
--mysql-password=$PASS \
--mysql-db=$DB \
--mysql-table-engine=$ENGINE \
--mysql-socket=$SOCKET \
--oltp-read-only \
--oltp-test-mode=simple \
--num-threads=$THREAD run \
>> $LOG
sysbench --test=oltp \
--db-driver=mysql \
--oltp-table-size=$SIZE \
--mysql-host=$HOST \
--mysql-port=$PORT \
--mysql-user=$USER \
--mysql-password=$PASS \
--mysql-db=$DB \
--mysql-table-engine=$ENGINE \
--mysql-socket=$SOCKET \
cleanup
[root@MySQLSlaveDB3 BenchScript]#
댓글 없음:
댓글 쓰기