MariaDB 10.1 不僅僅包含大量的新特性,同時還有非常大的性能提升。最重要的改進是大量多線程硬件擴展。
以下的數據是 MariaDB-10.1.8 和 MariaDB-10.0.21 基於簡單 OLTP 基準 SysBench 工具測試的對比:
queries per second in simplified OLTP
OLTP clients | MariaDB-10.0.21 | MariaDB-10.1.8 | increase |
---|---|---|---|
160 | 398124 | 930778 | 135% |
200 | 397102 | 1024311 | 159% |
240 | 395661 | 1108756 | 181% |
320 | 396285 | 1142464 | 190% |
基準測試詳情
此基準測試是 sysbench-mariadb (sysbench 主幹的一個修復,提供可以生成更多的隨機數的生成器) OLTP 簡單測試每個事物 1000 點選項。數據集是 20 張表的 100 萬行。可以使用更好的表,但是低於 4 個表,性能會有所下降,因爲表定義緩存的一個熱響應區。
測試所使用的 my.cnf:
[mysqld]
max_connections = 400
table_open_cache = 800
query_cache_type = 0
innodb_buffer_pool_size = 512M
innodb_buffer_pool_instances = 10
innodb_adaptive_hash_index_partitions = 20
性能測試命令行:
sysbench-mariadb --test=lua/oltp.lua --oltp-tables-count=20 \
--oltp-table-size=50000 --num-threads=... --oltp-read-only=on \
--oltp-point-selects=1000 --oltp-distinct-ranges=0 \
--oltp-simple-ranges=0 --oltp-sum-ranges=0 --oltp-order-ranges=0 \
--max-time=100 --max-requests=0 run
硬件/軟件 詳情
基準測試在 IBM “Firestone” S822LC Power8 服務器上運行,服務器包含 2 sockets, 20 cores 和 8-way SMT (160 hardware threads)。機器運行 PowerKVM 3.1 和在 KVM 運行一個 Ubuntu 14.04.3 LTS (ppc64le) guest。MariaDB-10.1.8 和 sysbench-mariadb 使用 IBM 的 Advance Tool Chain 8.0 編譯器在本地進行編譯。
最後
MariaDB 源代碼的改進大大的提升了性能,也是移植 MariaDB 移植到 Power8 的一部分,一些值得關注的改進:
MDEV-6089 MySQL WL#7305 “使用 lock-free hash 改進 MDL 擴展性”
MDEV-7004 從 10.0-power 合併擴展性修復
MDEV-7324 爲表定義緩存提供 Lock-free hash
IBM 發佈了一些在 Power8 的 MariaDB 白名單,還有對比 Intel 硬件,MariaDB 如何在 Power8 上運行的細節。
本文章轉自OSChina