騰訊雲MySQL例項高IO版效能測試報告
資料庫基準效能測試為 sysbench 0.5。
工具修改說明:
對 sysbench 自帶的 otlp 指令碼做了修改,讀寫比例修改為 1:1,並通過執行測試命令引數 oltp_point_selects 和 oltp_index_updates 來控制讀寫比例,本文測試用例的均採用 4 個 select 點,1 個 update 點,讀寫比例保持 4:1。
測試環境
型別 |
說明 |
例項物理機器 |
高 IO 版-單機器最高可支撐 488 GB 記憶體 6 T 硬碟資料庫 |
例項規格 |
當前售賣主流配置規格(詳見下文測試用例) |
客戶端配置 |
4 核 8 GB 記憶體 |
客戶端數量 |
1~6 個(配置的提升,客戶端數量也需要相應提升) |
網路環境 |
萬兆網路機房,網路延時 < 0.05 ms |
環境負載 |
安裝 mysql 機器負載 > 70% (針對非獨佔例項) |
- 客戶端規格說明:機器採用了較高配置的客戶機器,保證單客戶端可以壓測出資料庫例項的效能,如果客戶端配置規格較小,建議採用多個客戶並行壓測例項來求取資料總和。
- 網路延時說明:測試環境保證客戶端機器與資料庫例項在同一可用區,測試結果不受網路環境影響。
測試方法
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;
2. 測試資料行格式
id: 1 k: 20106885 c: 08566691963-88624912351-16662227201-46648573979-64646226163-77505759394-75470094713-41097360717-15161106334-50535565977 pad: 63188288836-92351140030-06390587585-66802097351-4928296184
3. 資料準備
/root//sysbench/sysbench --mysql-host=xxxx --mysql-port=xxxx --mysql-user=xxx --mysql-password=xxx --mysql-db=test --mysql-table-engine=innodb --test=tests/db/oltp.lua --oltp_tables_count=20 --oltp-table-size=10000000 --rand-init=on prepare
資料準備引數說明:
- --test=tests/db/oltp.lua,表示呼叫 tests/db/oltp.lua 指令碼進行 oltp 模式測試。
- --oltp_tables_count=20,表示用於測試的表數量為 20 張。
- --oltp-table-size=10000000,表示每個測試表填充資料行數為 1000 W 行。
- --rand-init=on,表示每個測試表都是用隨機資料來填充的。
4. 效能壓測命令
/root//sysbench/sysbench --mysql-host=xxxx --mysql-port=xxx --mysql-user=xxx --mysql-password=xxx --mysql-db=test --test=/root/sysbench_for_z3/sysbench/tests/db/oltp.lua --oltp_tables_count=xx --oltp-table-size=xxxx --num-threads=xxx --oltp-read-only=off --rand-type=special --max-time=600 --max-requests=0 --percentile=99 --oltp-point-selects=4 run
效能壓測引數說明:
- --test=/root/sysbench_for_z3/sysbench/tests/db/oltp.lua,表示呼叫 /root/sysbench_for_z3/sysbench/tests/db/oltp.lua 指令碼進行 oltp 模式測試。。
- --oltp_tables_count=20,表示本次用於測試的表數量為 20 張。
- --oltp-table-size=10000000,表示本次測試使用的錶行數均為 1000 W 行。
- --num-threads=128,表示本次測試的客戶端連線併發數為 128。
- --oltp-read-only=off ,off 表示測試關閉只讀測試模型,採用讀寫混合模型。
- --rand-type=special,表示隨機模型為特定的。
- --max-time=1800,表示本次測試的執行時間。
- --max-requests=0,0 表示不限制總請求數,而是按 max-time 來測試。
- --percentile=99,表示設定取樣比例,預設是 95%,即丟棄 1% 的長請求,在剩餘的 99% 裡取最大值。
- --oltp-point-selects=4,表示 oltp 指令碼中 sql 測試命令,select 操作次數為 4,預設值為 1。
5. 場景模型
本文用例均使用場景指令碼 our_oltp.lua,修改為 4 個 select 點查詢,1 個 update (索引列),讀寫比為 4:1。
針對最大配置型別,對資料場景增加了引數調優模型,測試結果見下文測試結果 。
測試引數
例項規格 |
儲存空間 |
表數量 |
錶行數 |
資料集大小 |
併發數 |
執行時間(m) |
2核 4GB |
200GB |
8 |
4000W |
76GB |
128 |
30 |
4核 8GB |
200GB |
15 |
4000W |
142GB |
128 |
30 |
4核 16GB |
400GB |
25 |
4000W |
238GB |
128 |
30 |
8核 32GB |
700GB |
25 |
4000W |
238GB |
128 |
30 |
16核 64GB |
1T |
40 |
4000W |
378GB |
256 |
30 |
16核 96GB |
1.5T |
40 |
4000W |
378GB |
128 |
30 |
16核 128GB |
2T |
40 |
4000W |
378GB |
128 |
30 |
24核 244GB |
3T |
60 |
4000W |
567GB |
128 |
30 |
48核 488GB |
6T |
60 |
4000W |
567GB |
128 |
30 |
48核 488GB(調優) |
6 T |
60 |
1000W |
140 GB |
128 |
30 |
測試結果
例項規格 |
儲存空間 |
資料集 |
客戶端數 |
單客戶端併發數 |
QPS |
TPS |
2核 4GB |
200GB |
76GB |
1 |
128 |
4082 |
816 |
4核 8GB |
200GB |
142GB |
1 |
128 |
6551 |
1310 |
4核 16GB |
400GB |
238GB |
1 |
128 |
11098 |
2219 |
8核 32GB |
700GB |
238GB |
2 |
128 |
20484 |
3768 |
16核 64GB |
1T |
378GB |
2 |
128 |
36395 |
7279 |
16核 96GB |
1.5T |
378GB |
3 |
128 |
56464 |
11292 |
16核 128GB |
2T |
378GB |
3 |
128 |
81752 |
16350 |
24核 244GB |
3T |
567GB |
4 |
128 |
98528 |
19705 |
48核 488GB |
6T |
567GB |
6 |
128 |
142246 |
28449 |
48核 488GB(調優) |
6T |
140GB |
6 |
128 |
245509 |
46304 |