git clone https://github.com/akopytov/sysbench 目錄結構 root@itcast01:/home/aiapple/sysbench# ls autogen.sh configure.ac install-sh missing README-WIN.txt ChangeLog COPYING m4 mkinstalldirs sysbench config doc Makefile.am README.md TODO2. 編譯&安裝
./autogen.sh ./configure --prefix=/home/sysbench make make install
3. sysbench流程
sysbench --test=parallel_prepare.lua --oltp_tables_count=1 --rand-init=on --oltp-table-size=500000000 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-requests=0 prepare
sysbench表結構
b)運行測試--run
sysbench --test=oltp.lua --oltp_tables_count=1 --num-threads=100 --oltp-table-size=500000000 --oltp-read-only=off --report-interval=10 --rand-type=uniform --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-time=1000 --max-requests=0 run
特殊情況
[10s]--------------運行時間點
Threads:100------100個線程數
tps:378.90---------每秒執行378.9個事務
reads:-------------讀請求數
writes:------------寫請求數
response time:--響應時間
errors:-------------錯誤個數
reconnects:-------重新連接個數
數據匯總
關注
c)清理數據(cleanup)
sysbench --test=parallel_prepare.lua --oltp_tables_count=1 --rand-init=on --oltp-table-size=500000000 --mysql-host=127.0.0.1 --mysql-port=3306 --mysql-user=sys --mysql-password=netease --mysql-db=sbtest --max-requests=0 cleanup