人妖在线一区,国产日韩欧美一区二区综合在线,国产啪精品视频网站免费,欧美内射深插日本少妇

新聞動(dòng)態(tài)

Mysql常用基準(zhǔn)測(cè)試命令總結(jié)

發(fā)布日期:2022-03-17 17:19 | 文章來源:源碼中國(guó)

mysqlslap

常用參數(shù)說明

  • –auto-generate-sql 由系統(tǒng)自動(dòng)生成sql腳本進(jìn)行測(cè)試
  • –auto-generate-sql-add-autoincrement 在生成的表中增加自增ID
  • –auto-generate-sql-load-type 指定測(cè)試中使用的查詢類型
  • –auto-generate-sql-write-number 制定初始化數(shù)據(jù)時(shí)生成的數(shù)據(jù)量
  • –concurrency 指定并發(fā)線程的數(shù)量
  • –engine 指定要測(cè)試表的存儲(chǔ)引擎,逗號(hào)分隔多個(gè)
  • –no-drop 不清理測(cè)試數(shù)據(jù)(一般不設(shè)置)
  • –iterations 指定測(cè)試運(yùn)行的次數(shù)
  • –number-of-queries 指定每一個(gè)線程執(zhí)行的查詢數(shù)量
  • –debug-info 指定輸出額外的內(nèi)存及cpu統(tǒng)計(jì)信息
  • –number-int-cols 指定測(cè)試表中包含的int類型列的數(shù)量
  • –number-char-cols指定測(cè)試表中包含的varchar類型數(shù)量
  • –create-schema 指定用于執(zhí)行測(cè)試的數(shù)據(jù)庫名字
  • –query 用于指定自定義sql的腳本
  • –only-print 并不運(yùn)行測(cè)試腳本,而是把生產(chǎn)的腳本打印出來

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è)試

  • –mysql-db 用于指定執(zhí)行基準(zhǔn)測(cè)試的數(shù)據(jù)庫名
  • –mysql-table-engine 用于指定所使用的存儲(chǔ)引擎
  • –oltp-tables-count 執(zhí)行測(cè)試的表數(shù)量
  • –oltp-table-size 指定每個(gè)表中的數(shù)據(jù)行數(shù)
  • –num-threads 制定測(cè)試的并發(fā)線程數(shù)量
  • –max-time 指定測(cè)試最大時(shí)間 s
  • –report-interval 指定間隔多長(zhǎng)時(shí)間輸出一次統(tǒng)計(jì)信息
  • –mysql-user 指定執(zhí)行測(cè)試的mysql用戶
  • –mysql-password 密碼

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ù)說明

  • –auto-generate-sql 由系統(tǒng)自動(dòng)生成sql腳本進(jìn)行測(cè)試
  • –auto-generate-sql-add-autoincrement 在生成的表中增加自增ID
  • –auto-generate-sql-load-type 指定測(cè)試中使用的查詢類型
  • –auto-generate-sql-write-number 制定初始化數(shù)據(jù)時(shí)生成的數(shù)據(jù)量
  • –concurrency 指定并發(fā)線程的數(shù)量
  • –engine 指定要測(cè)試表的存儲(chǔ)引擎,逗號(hào)分隔多個(gè)
  • –no-drop 不清理測(cè)試數(shù)據(jù)(一般不設(shè)置)
  • –iterations 指定測(cè)試運(yùn)行的次數(shù)
  • –number-of-queries 指定每一個(gè)線程執(zhí)行的查詢數(shù)量
  • –debug-info 指定輸出額外的內(nèi)存及cpu統(tǒng)計(jì)信息
  • –number-int-cols 指定測(cè)試表中包含的int類型列的數(shù)量
  • –number-char-cols指定測(cè)試表中包含的varchar類型數(shù)量
  • –create-schema 指定用于執(zhí)行測(cè)試的數(shù)據(jù)庫名字
  • –query 用于指定自定義sql的腳本
  • –only-print 并不運(yùn)行測(cè)試腳本,而是把生產(chǎn)的腳本打印出來

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è)試

  • –mysql-db 用于指定執(zhí)行基準(zhǔn)測(cè)試的數(shù)據(jù)庫名
  • –mysql-table-engine 用于指定所使用的存儲(chǔ)引擎
  • –oltp-tables-count 執(zhí)行測(cè)試的表數(shù)量
  • –oltp-table-size 指定每個(gè)表中的數(shù)據(jù)行數(shù)
  • –num-threads 制定測(cè)試的并發(fā)線程數(shù)量
  • –max-time 指定測(cè)試最大時(shí)間 s
  • –report-interval 指定間隔多長(zhǎng)時(shí)間輸出一次統(tǒng)計(jì)信息
  • –mysql-user 指定執(zhí)行測(cè)試的mysql用戶
  • –mysql-password 密碼

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ì)本站的支持。

香港穩(wěn)定服務(wù)器

版權(quán)聲明:本站文章來源標(biāo)注為YINGSOO的內(nèi)容版權(quán)均為本站所有,歡迎引用、轉(zhuǎn)載,請(qǐng)保持原文完整并注明來源及原文鏈接。禁止復(fù)制或仿造本網(wǎng)站,禁止在非www.sddonglingsh.com所屬的服務(wù)器上建立鏡像,否則將依法追究法律責(zé)任。本站部分內(nèi)容來源于網(wǎng)友推薦、互聯(lián)網(wǎng)收集整理而來,僅供學(xué)習(xí)參考,不代表本站立場(chǎng),如有內(nèi)容涉嫌侵權(quán),請(qǐng)聯(lián)系alex-e#qq.com處理。

相關(guān)文章

實(shí)時(shí)開通

自選配置、實(shí)時(shí)開通

免備案

全球線路精選!

全天候客戶服務(wù)

7x24全年不間斷在線

專屬顧問服務(wù)

1對(duì)1客戶咨詢顧問

在線
客服

在線客服:7*24小時(shí)在線

客服
熱線

400-630-3752
7*24小時(shí)客服服務(wù)熱線

關(guān)注
微信

關(guān)注官方微信
頂部