使用 sysbench 对 mysql 进行基准测试

安装 system, 在 centos 7上可以直接使用 yum 安装

yum install epel-release -y
yum install sysbench -y

执行测试用例

host=172.30.26.11
user=test
pwd=test
db=test

sysbench --test=oltp_common --table-size=5000000 \
--mysql-host=$host \
--mysql-db=$db \
--mysql-user=$user \
--mysql-password=$pwd \
#prepare
dryrun

sysbench --test=oltp_insert --table-size=5000000 \
--mysql-host=$host \
--mysql-db=$db \
--mysql-user=$user \
--mysql-password=$pwd \
run

sysbench --test=oltp_write_only --table-size=5000000 \
--mysql-host=$host \
--mysql-db=$db \
--mysql-user=$user \
--mysql-password=$pwd \
run

sysbench --test=oltp_read_only --table-size=5000000 \
--mysql-host=$host \
--mysql-db=$db \
--mysql-user=$user \
--mysql-password=$pwd \
run

sysbench --test=oltp_read_write --table-size=5000000 \
--mysql-host=$host \
--mysql-db=$db \
--mysql-user=$user \
--mysql-password=$pwd \
run

发表评论