MySQL基準測試工具sysbench
MySQL基準測試工具sysbench
sysbench多執行緒效能測試工具,可以測試cpu/memory/IO/資料庫等效能。
2個版本sysbench0.4和sysbench0.5介紹:
我們先了解對資料庫OLTP測試:
sysbench --help
Usage:
sysbench [general-options]... --test= [test-options]... command
--test:測試型別,有fileio/memory/threads/mutex.
sysbench0.5與sysbench0.4區別:0.5支援多表測試,執行實時列印統計資訊,自定義lua指令碼;
--test=
2者測試模組如下:
sysbench0.5:
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
sysbench0.5:
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
oltp - OLTP test #與0.5不同點
--general-options
每個模組對應的general-options可以藉助:
sysbench --test=oltp help
因0.4和0.5版本不同,但是基本引數是相容的;
--command
經歷prepare run cleaup
prepare:準備過程,oltp測試向表中load資料
run:正式測試過程
cleanup是清理過程,run後需要清理測試過程中遺留下來的資訊。
sysbench測試例項:
--prepare:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 prepare
--run:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 run
--cleanup:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 cleanup
3者測試引數一致,不同的階段使用的引數不同;
引數瞭解:
--test:指定測試模式對應的lua檔案,這個裝好sysbench就有且這是0.5新增,0.4只需直接--test=oltp即可。
--oltp_table_count=1:指定測試過程中表的個數,0.5新增,0.4整個測試過程只有一個表。
--oltp-table-size=:指定表的大小,如果指定1000,那麼它會往表裡初始化1000條資料
--rand-init=on:是否隨機初始化資料,如果不隨機化那麼初始好的資料每行內容除了主鍵不同外其他完全相同。
--num-threads=:測試過程中併發執行緒數,看測試要求來定併發壓力。
--otlp-read-only=off:知否只讀測試
--report-interval=10:每隔多久列印一次統計資訊,單位秒,0.5新增
--rand-type=special:資料分佈模式,special表示存在熱點資料,uniform表示非熱點資料模式,還有其他幾個選項。
--rand-spec-pct=5:這個與上面那個選項相關
--mysql-table-engine=$type:表的儲存引擎型別,innodb/myisam/tokudb/這些都可以。
--max-time=8000:這個命令跑多長時間,單位秒,與之相反的是指定請求數--max-requests
--mysql-host=$host --mysql-port=$port --mysql-user=test --mysql-password=test --mysql-db=test1 這幾個表示被測試的MySQL例項資訊,因為需要連資料庫
--max-requests:可以兩者形式指定命令執行多長時間。
綜上所述:
sysbench優點:
1.測試型別可以選擇
2.定製的引數選擇豐富
缺點:
1.測試表結構太簡單;
CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
有效僅有3個欄位,不能正式模擬線上應用,可以利用它來做指導測試,作為標準,
測試產品穩定性,抗壓性,mysql打補丁,更改引數,利用sysbench跑上幾天或更久
時間看起執行情況;
網頁摘錄
sysbench多執行緒效能測試工具,可以測試cpu/memory/IO/資料庫等效能。
2個版本sysbench0.4和sysbench0.5介紹:
我們先了解對資料庫OLTP測試:
sysbench --help
Usage:
sysbench [general-options]... --test=
--test:測試型別,有fileio/memory/threads/mutex.
sysbench0.5與sysbench0.4區別:0.5支援多表測試,執行實時列印統計資訊,自定義lua指令碼;
--test=
2者測試模組如下:
sysbench0.5:
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
sysbench0.5:
Compiled-in tests:
fileio - File I/O test
cpu - CPU performance test
memory - Memory functions speed test
threads - Threads subsystem performance test
mutex - Mutex performance test
oltp - OLTP test #與0.5不同點
--general-options
每個模組對應的general-options可以藉助:
sysbench --test=oltp help
因0.4和0.5版本不同,但是基本引數是相容的;
--command
經歷prepare run cleaup
prepare:準備過程,oltp測試向表中load資料
run:正式測試過程
cleanup是清理過程,run後需要清理測試過程中遺留下來的資訊。
sysbench測試例項:
--prepare:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 prepare
--run:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 run
--cleanup:
sysbench --test=/home/zbs/sysbench-0.5/sysbench/tests/db/parallel_prepare.lua
--oltp_tables_count=1
--oltp-table-size=$records
--rand-init=on
--num-threads=$thds
--oltp-read-only=off
--report-interval=10
--rand-type=special
--rand-spec-pct=5
--mysql-table-engine=$type
--max-time=8000
--mysql-host=$host
--mysql-port=$port
--mysql-user=test
--mysql-password=test
--mysql-db=test1
--max-requests=0 cleanup
3者測試引數一致,不同的階段使用的引數不同;
引數瞭解:
--test:指定測試模式對應的lua檔案,這個裝好sysbench就有且這是0.5新增,0.4只需直接--test=oltp即可。
--oltp_table_count=1:指定測試過程中表的個數,0.5新增,0.4整個測試過程只有一個表。
--oltp-table-size=:指定表的大小,如果指定1000,那麼它會往表裡初始化1000條資料
--rand-init=on:是否隨機初始化資料,如果不隨機化那麼初始好的資料每行內容除了主鍵不同外其他完全相同。
--num-threads=:測試過程中併發執行緒數,看測試要求來定併發壓力。
--otlp-read-only=off:知否只讀測試
--report-interval=10:每隔多久列印一次統計資訊,單位秒,0.5新增
--rand-type=special:資料分佈模式,special表示存在熱點資料,uniform表示非熱點資料模式,還有其他幾個選項。
--rand-spec-pct=5:這個與上面那個選項相關
--mysql-table-engine=$type:表的儲存引擎型別,innodb/myisam/tokudb/這些都可以。
--max-time=8000:這個命令跑多長時間,單位秒,與之相反的是指定請求數--max-requests
--mysql-host=$host --mysql-port=$port --mysql-user=test --mysql-password=test --mysql-db=test1 這幾個表示被測試的MySQL例項資訊,因為需要連資料庫
--max-requests:可以兩者形式指定命令執行多長時間。
綜上所述:
sysbench優點:
1.測試型別可以選擇
2.定製的引數選擇豐富
缺點:
1.測試表結構太簡單;
CREATE TABLE `sbtest1` (
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`k` int(10) unsigned NOT NULL DEFAULT '0',
`c` char(120) NOT NULL DEFAULT '',
`pad` char(60) NOT NULL DEFAULT '',
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
有效僅有3個欄位,不能正式模擬線上應用,可以利用它來做指導測試,作為標準,
測試產品穩定性,抗壓性,mysql打補丁,更改引數,利用sysbench跑上幾天或更久
時間看起執行情況;
網頁摘錄
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26855487/viewspace-775897/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 資料庫基準測試工具 sysbench資料庫
- 利用sysbench進行MySQL OLTP基準測試MySql
- [轉帖]sysbench基準測試
- 使用Sysbench對滴滴雲MySQL進行基準測試MySql
- sysbench 測試MySQLMySql
- 【總結】簡述 MySQL 基準測試工具MySql
- [總結] 簡述 MySQL 基準測試工具MySql
- MySQL 效能壓測工具-sysbench,從入門到自定義測試項MySql
- MYSQL 效能測試方法 - 基準測試(benchmarking)MySql
- MySQL學習 - 基準測試MySql
- 通過sysbench工具實現MySQL資料庫的效能測試MySql資料庫
- mysql ,tidb sysbench 測試結果記錄MySqlTiDB
- 使用sysbench測試mysql及postgresql(完整版)MySql
- 公有云RDS-MySQL基準測試MySql
- hadoop基準測試_Hadoop TeraSort基準測試Hadoop
- mysql之 sysbench0.4.12資料庫效能測試MySql資料庫
- sysbench 壓力測試
- NewSQL資料庫壓力測試工具系列——SysbenchSQL資料庫
- 開源多執行緒效能測試工具-sysbench執行緒
- 基準測試
- MySQL效能基準測試對比:5.7 VS 8.0MySql
- TGI 基準測試
- benchmark 基準測試
- MinkowskiEngine基準測試
- [資料庫]000 - ?Sysbench 資料庫壓力測試工具資料庫
- mysql之 sysbench1.0.3 安裝與系統壓力測試MySql
- 華納雲:如何使用HammerDB進行MySQL基準測試MySql
- 使用 Sysbench 進行 Linux 效能測試Linux
- 【基準測試】BenchmarkDotNet介紹
- JMH- benchmark基準測試
- postgresql:pgbench基準效能測試SQL
- 使用sysbench壓力測試MySQL(一)(r11筆記第3天)MySql筆記
- JMH--一款由OpenJDK開發的基準測試工具JDK
- nosql redis資料庫壓力測試基準工具redis-benchmarkSQLRedis資料庫
- Lettuce和Jedis的基準測試
- ubuntu 快速測試 cpu 基準水平Ubuntu
- Linkerd和Istio基準測試 - linkerd
- MySQL 5.7和8.0 MHA架構下sysbench壓測MySql架構
- 資料庫效能測試:sysbench用法詳解資料庫