標籤:sysbench
sysbench 依賴的包: m4 autoconf automake libtool
yum install m4 autoconf automake libtool
安裝:
tar zxvf sysbench-0.5.tar.gz
cd sysbench-0.5
chmod +x autogen.sh
./autogen.sh
./configure --with-mysql-includes=/usr/local/mysql/include --with-mysql-libs=/usr/local/mysql/lib
make & make install
構造資料:
sysbench --test=/usr/local/src/sysbench-0.5/sysbench/tests/db/oltp.lua --oltp_secondary=on --oltp_tables_count=10 --oltp-table-size=2000000 --db-driver=mysql --mysql-user=root --mysql-password=‘superdata123‘ --mysql-port=3306 --mysql-host=‘localhost‘ --mysql-db=test prepare
測試:
sysbench --test=/usr/local/src/sysbench-0.5/sysbench/tests/db/oltp.lua --oltp-read-only=off --init-rng=on --num-threads=100 --max-requests=200000 --oltp-dist-type=uniform --max-time=1800 --mysql-user=superdata --oltp-table-size=2000000 --oltp_tables_count=10 --rand-init=on --mysql-password=‘xxxx‘ --mysql-port=3306 --mysql-host=‘xxxxx‘ --db-driver=mysql --mysql-db=test run
--oltp-read-only=on 只測試讀
--init-rng=on 在測試開始時是否初始化隨機發生器,預設是off
--num-thread 多少個並發連接線程
報錯資訊:
sysbench: error while loading shared libraries: libmysqlclient.so.18: cannot open shared object file: No such file or directory
export LD_LIBRARY_PATH=/usr/local/mysql/lib 輸出這個變數即可
測試結果分析
650) this.width=650;" src="https://s4.51cto.com/wyfs02/M01/8E/29/wKiom1i3jGHieS9JAABawHywh1E583.png-wh_500x0-wm_3-wmp_4-s_3490831340.png" title="QQ圖片20170302110706.png" alt="wKiom1i3jGHieS9JAABawHywh1E583.png-wh_50" />
本文出自 “11958098” 部落格,請務必保留此出處http://11968098.blog.51cto.com/11958098/1902561
sysbench 0.5 安裝及 MySQL 基準測試