国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 數(shù)據(jù)庫 > MySQL > 正文

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

2024-07-25 19:09:08
字體:
供稿:網(wǎng)友

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ì)VeVb武林網(wǎng)的支持。


注:相關(guān)教程知識(shí)閱讀請(qǐng)移步到MYSQL教程頻道。
發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 贡觉县| 溧阳市| 平山县| 自治县| 鄂伦春自治旗| 四会市| 依兰县| 中江县| 锦屏县| 五寨县| 大连市| 宁蒗| 方山县| 江永县| 宁德市| 云霄县| 三河市| 大足县| 瑞金市| 黑龙江省| 渭源县| 永安市| 盈江县| 界首市| 五莲县| 临泽县| 西青区| 西城区| 萍乡市| 大石桥市| 临邑县| 安溪县| 石景山区| 温宿县| 河东区| 永康市| 长乐市| 安仁县| 云阳县| 武宣县| 息烽县|