mysqlslap
常用參數(shù)說明
mysqlslap --concurrency=1,50,100,200 --iterations=3 --number-int-cols=5 --number-char-cols=5 --auto-generate-sql --auto-generate-sql-add-autoincrement --engine=myisam,innodb --number-of-queries=10 --create-schema=sbtest
sysbench
安裝說明
# 下載https://gihub.com/akopytov/sysbench/archive/0.5.zip# 解壓unzip sysbench-0.5zip
cd sysbench
./autogen.sh# 配置自己的mysql include 和 lib目錄./configure --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/
make && make install
常用參數(shù)
–test 用于指定索要執(zhí)行的測試類型 支持一下參數(shù)
Fileio 文件系統(tǒng)I/O性能測試
cpu cpu性能測試
memory 內(nèi)存性能測試
prepare 用于準備測試數(shù)據(jù)
run 運行測試
cleanup 清除測試數(shù)據(jù)
# 對cpu進行測試sysbench --test=cpu --cpu-max-prime=10000 run# 磁盤I/O測試 首先準備數(shù)據(jù)要大于內(nèi)存sysbench --test=Fileio --file-total-size=1Gpreparesysbench --test=Fileio --num--threads=8 --init-rgn=on -file-total-size=1G --file-test-mode=rndrw --report-interval=1# 數(shù)據(jù)庫性能測試 建立基準測試的用戶密碼數(shù)據(jù),然后進入sysbench的test目錄下,利用lua腳本測試sysbench --test=./oltp.lua --mysql-table-engine=innodb --oltp-table-size=10000 --mysql-db=db_name --mysql-user=user_name --mysql-password=password --oltp-tables-count=10 --mysql-socket=/usr/local/mysql/data/mysql.sock prepare# 開始測試,將上述命令的prepare改為run
mysqlslap
常用參數(shù)說明
mysqlslap --concurrency=1,50,100,200 --iterations=3 --number-int-cols=5 --number-char-cols=5 --auto-generate-sql --auto-generate-sql-add-autoincrement --engine=myisam,innodb --number-of-queries=10 --create-schema=sbtest
sysbench
安裝說明
# 下載https://gihub.com/akopytov/sysbench/archive/0.5.zip# 解壓unzip sysbench-0.5zip
cd sysbench
./autogen.sh# 配置自己的mysql include 和 lib目錄./configure --with-mysql-includes=/usr/local/mysql/include/ --with-mysql-libs=/usr/local/mysql/lib/
make && make install
常用參數(shù)
–test 用于指定索要執(zhí)行的測試類型 支持一下參數(shù)
Fileio 文件系統(tǒng)I/O性能測試
cpu cpu性能測試
memory 內(nèi)存性能測試
prepare 用于準備測試數(shù)據(jù)
run 運行測試
cleanup 清除測試數(shù)據(jù)
# 對cpu進行測試sysbench --test=cpu --cpu-max-prime=10000 run# 磁盤I/O測試 首先準備數(shù)據(jù)要大于內(nèi)存sysbench --test=Fileio --file-total-size=1Gpreparesysbench --test=Fileio --num--threads=8 --init-rgn=on -file-total-size=1G --file-test-mode=rndrw --report-interval=1# 數(shù)據(jù)庫性能測試 建立基準測試的用戶密碼數(shù)據(jù),然后進入sysbench的test目錄下,利用lua腳本測試sysbench --test=./oltp.lua --mysql-table-engine=innodb --oltp-table-size=10000 --mysql-db=db_name --mysql-user=user_name --mysql-password=password --oltp-tables-count=10 --mysql-socket=/usr/local/mysql/data/mysql.sock prepare# 開始測試,將上述命令的prepare改為run
以上就是本次分享的全部內(nèi)容,感謝大家對VeVb武林網(wǎng)的支持。
新聞熱點
疑難解答
圖片精選