当前位置:Gxlcms > 数据库问题 > MySQL基准测试工具sysbench安装

MySQL基准测试工具sysbench安装

时间:2021-07-01 10:21:17 帮助过:18人阅读

libmysqlclient.so.18 (libc6,x86-64) => /opt/mysql/lib/libmysqlclient.so.18


安装

1. [root@db01 sysbench-1.0.9]# ./autogen.sh


[root@db01 sysbench-1.0.9]# ./configure --prefix=/usr/local/sysbench-1.0.9

[root@db01 sysbench-1.0.9]# make -j 4

[root@db01 sysbench-1.0.9]# make install


2. 将命令sysbench的路径写入环境变量PATH中.

[root@db01 ~]# grep ‘PATH‘ .bash_profile

PATH=/usr/local/sysbench-1.0.9/bin:/opt/mysql/bin:$PATH:$HOME/bin

export PATH


[root@db01 ~]# source .bash_profile


3. 查看命令sysbench使用的MySQL数据库的客户端库文件.

[root@db01 ~]# ldd /usr/local/sysbench-1.0.9/bin/sysbench | grep ‘mysql‘

libmysqlclient.so.18 => /opt/mysql/lib/libmysqlclient.so.18 (0x00007f4376099000)


下面分别是fileio和oltp的测试实例.

1. [root@db01 sysbench_test]# sysbench fileio --file-num=4 --file-block-size=16384 --file-total-size=100G --file-test-mode=rndrd --file-extra-flags=direct --threads=16 --events=0 --time=14400 --report-interval=4 --verbosity=3 [prepare | run | cleanup]


2. [root@db01 sysbench_test]# sysbench /usr/local/sysbench-1.0.9/share/sysbench/oltp_insert.lua --auto_inc=on --tables=10 --mysql_storage_engine=innodb --table_size=5000000 --threads=16 --events=0 --time=14400 --report-interval=4 --verbosity=3 --mysql-host=localhost --mysql-port=3306 --mysql-socket=/data/3306/mysql.sock --mysql-user=root --mysql-password=123456 --mysql-db=sbtest [prepare | run | cleanup]


若感兴趣可关注订阅号”数据库最佳实践”(DBBestPractice).技术分享

本文出自 “感动自己” 博客,请务必保留此出处http://coveringindex.blog.51cto.com/12533373/1968630

MySQL基准测试工具sysbench安装

标签:mysql benchmark tool sysbench install...

人气教程排行