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í)行的測(cè)試類型 支持一下參數(shù)
Fileio 文件系統(tǒng)I/O性能測(cè)試
cpu cpu性能測(cè)試
memory 內(nèi)存性能測(cè)試
prepare 用于準(zhǔn)備測(cè)試數(shù)據(jù)
run 運(yùn)行測(cè)試
cleanup 清除測(cè)試數(shù)據(jù)
# 對(duì)cpu進(jìn)行測(cè)試sysbench --test=cpu --cpu-max-prime=10000 run# 磁盤I/O測(cè)試 首先準(zhǔn)備數(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ù)庫性能測(cè)試 建立基準(zhǔn)測(cè)試的用戶密碼數(shù)據(jù),然后進(jìn)入sysbench的test目錄下,利用lua腳本測(cè)試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# 開始測(cè)試,將上述命令的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í)行的測(cè)試類型 支持一下參數(shù)
Fileio 文件系統(tǒng)I/O性能測(cè)試
cpu cpu性能測(cè)試
memory 內(nèi)存性能測(cè)試
prepare 用于準(zhǔn)備測(cè)試數(shù)據(jù)
run 運(yùn)行測(cè)試
cleanup 清除測(cè)試數(shù)據(jù)
# 對(duì)cpu進(jìn)行測(cè)試sysbench --test=cpu --cpu-max-prime=10000 run# 磁盤I/O測(cè)試 首先準(zhǔn)備數(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ù)庫性能測(cè)試 建立基準(zhǔn)測(cè)試的用戶密碼數(shù)據(jù),然后進(jìn)入sysbench的test目錄下,利用lua腳本測(cè)試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# 開始測(cè)試,將上述命令的prepare改為run
以上就是本次分享的全部?jī)?nèi)容,感謝大家對(duì)VeVb武林網(wǎng)的支持。
新聞熱點(diǎn)
疑難解答
圖片精選