基準性能測試

1.Mysq 基準測試工作之 sysbench

1.1)安裝說明

https://github.com/akopytov/sysbench/archive/0.5.zip

unzip sysbench-0.5.zip

cd sysbench

./autogen.sh

./configure --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/

make&&make install

報錯解決方案:https://blog.csdn.net/zengxuewen2045/article/details/52333381

1.2) 使用方法

常用性能測試類型

--test 用于指定所要執(zhí)行的測試類型,支持以下參數(shù)

Filleio 文件系統(tǒng) I/O 性能測試

cpu cpu 性能測試

memory 內(nèi)存性能測試

oltp 測試要指定具體的 lua 腳本

lua腳本位于:sysbench-0.5/sysbench/test/db


常用參數(shù)

--myql-db 用于指定執(zhí)行基準測試的數(shù)據(jù)庫名

--mysql-table-engIne 用于指定所使用的存儲引擎

--oltp-tables-count 執(zhí)行測試的表的數(shù)量

--oltp-table-size 指定每個表中的數(shù)據(jù)行數(shù)

--num-threads 指定測試的并發(fā)線程數(shù)量

--max-time 指定最大的測試時間

--report-interval 指定間隔多長時間輸出一次統(tǒng)計信息

--mysql-user 指定執(zhí)行測試的 MySQL 用戶

--mysql-password 指定執(zhí)行測試的 MySQL 用戶的密碼

prepare 用于準備測試數(shù)據(jù)

run 用于實際進行測試

cleanup 用于清理測試數(shù)據(jù)


sysbench --test=cpu --cpu-max-prime=10000 run (CPU測試)



sysbench --test=fileio --num-threads=8 --init-rng=on --file-total-size=1G --file-test-mode=rndrw --report-interval=1 run (文件系統(tǒng))





sysbench--test=/oltp. lua --mysql-table-engine=innodb --oltp-table-size=10000--mysql-db=imooc --mysql-user=sbtest --mysql-password=123 --oltp--tables-count=10 --mysql-socket/usr/local/ mysql/data/mysql. sock prepare

數(shù)據(jù)性能測試



?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容