MYSQL 寫效能測試
以下是我在當前搭建的POC mysql cluster 環境裡,進行併發寫測試的資料。情況說明如下:
1. 模擬向10字元,10個數字欄位的表中插入資料。
2. 案例1~3, 都是同時插入1000條資料,但是併發的會話數依次增加。
3. 案例4~5, 同時插入10000條資料,併發會話數相同,但是4是使用搭建的POC環境,5是使用我在筆記本上搭建的虛擬環境。
4. 測試涵蓋了mysql中三種主要的儲存引擎,myisam是不支援事務的引擎,innodb是單節點資料引擎,ndbcluster是cluster資料引擎。
5. 每個測試案例測試了3次,所以資料應該是比較穩定的。
得到的結論如下,也請大家一起分析。
1. 在現有的POC環境配置下,隨著併發數提高,innodb的每秒處理數隨之增大,這個是合理的,隨之併發再增大後,時間增大,或不明向減少,表明已經達到壓力區了.
2. Ndbcluster,隨著併發數提高,每秒處理數有所增大,但是不大明顯,如案例1和案例2的情況;但是併發數再增大後,每秒的處理數反而降低了, 如案例3和案例4的情況。這是不正常的,估計可能跟機器的配置尤其是網路有關係。
3. Myisam,隨著併發數提高,每秒處理數減少,這個是由於它對併發的支援比較弱,是正常的。
4. 相同的測試案例,案例4在POC的機器上執行,innodb 的處理次數是100, 而案例5在筆記本的VM上執行,處理次數達到了644. 估計是跟POC的機器配置有關係。 (或者單機上的INNODB,和NDB cluster 整合在一起的INNODB效能不一樣,準備向公司申請好的機器
再做POC,目前的機器是在是超執行緒的CPU, 一臺機器物理上一core, 執行ls 命令都慢.)
--效能測試結果
案例一: 併發2個會話,每秒鐘完成處理次數:myisam=365 innodb=36 ndbcluster=72
[mysql@shadcdmsq02 ~]$ mysqlslap --concurrency=2 --iterations=1 \
> --number-int-cols=10 --number-char-cols=10 -a \
> --auto-generate-sql-add-autoincrement --number-of-queries=1000 \
> --auto-generate-sql-load-type=write --engine=myisam,innodb,ndbcluster
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 2.773 seconds
Minimum number of seconds to run all queries: 2.773 seconds
Maximum number of seconds to run all queries: 2.773 seconds
Number of clients running queries: 2
Average number of queries per client: 500
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 27.631 seconds
Minimum number of seconds to run all queries: 27.631 seconds
Maximum number of seconds to run all queries: 27.631 seconds
Number of clients running queries: 2
Average number of queries per client: 500
Benchmark
Running for engine ndbcluster
Average number of seconds to run all queries: 13.807 seconds
Minimum number of seconds to run all queries: 13.807 seconds
Maximum number of seconds to run all queries: 13.807 seconds
Number of clients running queries: 2
Average number of queries per client: 500
案例二: 併發20個回話,每秒鐘完成處理次數:myisam=305 innodb=99 ndbcluster=98
[mysql@shadcdmsq02 ~]$ mysqlslap --concurrency=20 --iterations=1 \
> --number-int-cols=10 --number-char-cols=10 -a \
> --auto-generate-sql-add-autoincrement --number-of-queries=1000 \
> --auto-generate-sql-load-type=write --engine=myisam,innodb,ndbcluster
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 3.274 seconds
Minimum number of seconds to run all queries: 3.274 seconds
Maximum number of seconds to run all queries: 3.274 seconds
Number of clients running queries: 20
Average number of queries per client: 50
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 10.030 seconds
Minimum number of seconds to run all queries: 10.030 seconds
Maximum number of seconds to run all queries: 10.030 seconds
Number of clients running queries: 20
Average number of queries per client: 50
Benchmark
Running for engine ndbcluster
Average number of seconds to run all queries: 10.174 seconds
Minimum number of seconds to run all queries: 10.174 seconds
Maximum number of seconds to run all queries: 10.174 seconds
Number of clients running queries: 20
Average number of queries per client: 50
案例三. 併發100個會話,每秒鐘完成處理次數:myisam=229 innodb=75 ndbcluster=76
[mysql@shadcdmsq02 ~]$ mysqlslap --concurrency=100 --iterations=1 \
> --number-int-cols=10 --number-char-cols=10 -a \
> --auto-generate-sql-add-autoincrement --number-of-queries=1000 \
> --auto-generate-sql-load-type=write --engine=myisam,innodb,ndbcluster
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 4.348 seconds
Minimum number of seconds to run all queries: 4.348 seconds
Maximum number of seconds to run all queries: 4.348 seconds
Number of clients running queries: 100
Average number of queries per client: 10
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 13.303 seconds
Minimum number of seconds to run all queries: 13.303 seconds
Maximum number of seconds to run all queries: 13.303 seconds
Number of clients running queries: 100
Average number of queries per client: 10
Benchmark
Running for engine ndbcluster
Average number of seconds to run all queries: 13.101 seconds
Minimum number of seconds to run all queries: 13.101 seconds
Maximum number of seconds to run all queries: 13.101 seconds
Number of clients running queries: 100
Average number of queries per client: 10
--測試案例四: 併發148個會話,插入10000條資料,每秒鐘完成處理次數:myisam=195 innodb=100 ndbcluster=49
[mysql@shadcdmsq02 ~]$ mysqlslap --concurrency=148 --iterations=1 \
--number-int-cols=10 --number-char-cols=10 -a \
--auto-generate-sql-add-autoincrement --number-of-queries=10000 \
--auto-generate-sql-load-type=write --engine=myisam,innodb,ndbcluster
Benchmark
Running for engine myisam
Average number of seconds to run all queries: 51.124 seconds
Minimum number of seconds to run all queries: 51.124 seconds
Maximum number of seconds to run all queries: 51.124 seconds
Number of clients running queries: 148
Average number of queries per client: 67
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 99.555 seconds
Minimum number of seconds to run all queries: 99.555 seconds
Maximum number of seconds to run all queries: 99.555 seconds
Number of clients running queries: 148
Average number of queries per client: 67
Benchmark
Running for engine ndbcluster
Average number of seconds to run all queries: 201.856 seconds
Minimum number of seconds to run all queries: 201.856 seconds
Maximum number of seconds to run all queries: 201.856 seconds
Number of clients running queries: 148
Average number of queries per client: 67
--測試案例五: 一臺筆記本上安裝的虛擬機器,記憶體512M,測試案例同案例四,每一秒執行次數:innodb=644
[mysql@vm1 ~]$ mysqlslap --concurrency=148 --iterations=1 \
--number-int-cols=10 --number-char-cols=10 -a \
--auto-generate-sql-add-autoincrement --number-of-queries=10000 \
--auto-generate-sql-load-type=write --engine=innodb
Benchmark
Running for engine innodb
Average number of seconds to run all queries: 15.512 seconds
Minimum number of seconds to run all queries: 15.512 seconds
Maximum number of seconds to run all queries: 15.512 seconds
Number of clients running queries: 148
Average number of queries per client: 67
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/674865/viewspace-1102860/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL索引效能測試MySql索引
- mysql簡單效能測試MySql
- MySQL 加密的效能測試MySql加密
- 使用sysbench測試Mysql效能MySql
- MySQL 效能測試工具mysqlslapMySql
- [Mysql]效能測試指令碼MySql指令碼
- MYSQL 效能測試方法 - 基準測試(benchmarking)MySql
- 【MySQL】資料庫效能測試MySql資料庫
- 使用 sysbench 測試 MySQL 的效能MySql
- 軟體效能測試有哪些測試指標?效能測試報告怎麼編寫?指標測試報告
- 效能測試報告編寫技巧測試報告
- 自己上手寫效能測試工具(二)
- mysql效能測試工具之tpcc-mysql薦MySql
- mysql效能測試工具之sysbench薦MySql
- mysql效能測試工具之mysqlslap薦MySql
- 使用 sysbench 測試 MySQL 的效能(二)MySql
- Mysql5.1 - mysqlslap效能測試工具MySql
- 效能測試——壓測工具locust——指令碼初步編寫指令碼
- 效能測試: 編寫一個 Locust 檔案
- linux dd 測試硬碟的讀寫效能Linux硬碟
- 如何用 JMeter 編寫效能測試指令碼?JMeter指令碼
- 使用tpcc-mysql對mysql進行TPCC效能測試MySql
- 【效能測試】使用ab做Http效能測試HTTP
- 軟體效能測試報告怎麼編寫?哪些機構可以出具效能測試報告測試報告
- 效能測試
- 效能測試:分散式測試分散式
- Jmeter介面測試+效能測試JMeter
- MySQL效能基準測試對比:5.7 VS 8.0MySql
- 6.linux->MySQL 安裝及效能測試LinuxMySql
- 幾個常見的MySQL效能測試工具RQMySql
- mysql資料庫索引的建立以及效能測試MySql資料庫索引
- 微服務測試之效能測試微服務
- 效能測試之測試指標指標
- 測試開發之效能篇-效能測試設計
- Jmeter效能測試:高併發分散式效能測試JMeter分散式
- 效能測試——效能測試-常見效能指標-總體概況指標
- MySQL 效能壓測工具,從入門到自定義測試項MySql
- Redis 效能測試Redis