GreatSQL vs MySQL性能測試來了,速圍觀~

来源:https://www.cnblogs.com/greatsql/archive/2022/09/12/16687033.html
-Advertisement-
Play Games

GreatSQL社區原創內容未經授權不得隨意使用,轉載請聯繫小編並註明來源。 GreatSQL是MySQL的國產分支版本,使用上與MySQL一致。 1.結論先行 無論ibp(innodb_buffer_pool_size)是否充足,MySQL的性能都遠不如GreatSQL。 MySQL的性能平均約為 ...


  • GreatSQL社區原創內容未經授權不得隨意使用,轉載請聯繫小編並註明來源。
  • GreatSQL是MySQL的國產分支版本,使用上與MySQL一致。

1.結論先行

  1. 無論ibp(innodb_buffer_pool_size)是否充足,MySQL的性能都遠不如GreatSQL。

  2. MySQL的性能平均約為GreatSQL的70%(最高84.5%,最低61.7%)。

  3. 在ibp充分的情況下,隨著併發數的增加,MySQL並沒有表現出該有的性能提升,反倒掉頭向下,可見還是不夠穩定。

  4. 在ibp不夠的情況下,GreatSQL開啟thread pool性能有所提升;當ibp充足的情況下,區別就不大了。

MySQL vs GreatSQL性能數據對比

48G 96G 144G 192G avg
MySQL vs GreatSQL 0.6173 0.735 0.721 0.8449 0.7295

各資料庫版本分別為

  • MySQL 8.0.30 MySQL Community Server - GPL

  • GreatSQL 8.0.25-16 GreatSQL, Release 16, Revision 8bb0e5af297

2.測試結果數據

2.1 ibp=48G

TPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 969.16 1324.21 1661.57 2007.98 2331.4
GreatSQL 873.06 1146.85 1371.34 1509.8 1699.19
MySQL 686.14 846.5 915.15 1073.95 1439.29

P.S,尾碼加上 thdpool 表示啟用了thread pool

QPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 19383.2 26484.14 33231.49 40159.56 46627.89
GreatSQL 17461.16 22937.14 27426.87 30196.02 33983.78
MySQL 13722.8 16929.94 18303.03 21479 28785.7

image-20220908213814606

2.2 ibp=96G

TPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 1074.57 1407.54 1706.35 2206.06 2810.39
GreatSQL 1013.2 1198.5 1546.53 2033.04 2419.47
MySQL 751.7 986.11 1218.87 1778.67 2065.69
QPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 21491.46 28150.73 34127 44121.2 56207.88
GreatSQL 20264.04 23969.97 30930.56 40660.83 48389.42
MySQL 15034.11 19722.27 24377.47 35573.39 41313.8

image-20220908214729737

2.3 ibp=144G

TPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 1059.46 1422.72 1853.24 2710.31 3481.66
GreatSQL 857.28 1327.67 1767.78 2660.8 3148.06
MySQL 857.05 1149.79 2038.3 2516.41 2510.15
QPS 8th 16th 32th 64th 128th
GreatSQL-thdpool 21189.17 28454.3 37064.79 54206.13 69633.25
GreatSQL 17145.52 26553.48 35355.47 53215.89 62961.17
MySQL 17140.96 22995.73 40765.95 50328.29 50202.93

image-20220908214759047

2.4 ibp=192G

TPS 8th 16th 32th 64th 128th
GreatSQL 1406.86 1316.02 2144.17 4114.55 3310.67
GreatSQL-thdpool 1391.2 1247.93 2085.81 4053.76 3113.97
MySQL 1367.31 2629.75 2940.51 2687.48 2797.06
QPS 8th 16th 32th 64th 128th
GreatSQL 28137.19 26320.43 42883.45 82291 66213.47
GreatSQL-thdpool 27823.9 24958.68 41716.16 81075.21 62279.48
MySQL 27346.18 52595.01 58810.18 53749.63 55941.29

image-20220908214812795

2.5 GreatSQL不同ibp下的數據

GreatSQL
TPS 8th 16th 32th 64th 128th QPS 8th 16th 32th 64th 128th
GreatSQL-thdpool(48G) 969.16 1324.21 1661.57 2007.98 2331.4 GreatSQL-thdpool(48G) 19383.2 26484.14 33231.49 40159.56 46627.89
GreatSQL(48G) 873.06 1146.85 1371.34 1509.8 1699.19 GreatSQL(48G) 17461.16 22937.14 27426.87 30196.02 33983.78
GreatSQL-thdpool(96G) 1074.57 1407.54 1706.35 2206.06 2810.39 GreatSQL-thdpool(96G) 21491.46 28150.73 34127 44121.2 56207.88
GreatSQL(96G) 1013.2 1198.5 1546.53 2033.04 2419.47 GreatSQL(96G) 20264.04 23969.97 30930.56 40660.83 48389.42
GreatSQL-thdpool(144G) 1059.46 1422.72 1853.24 2710.31 3481.66 GreatSQL-thdpool(144G) 21189.17 28454.3 37064.79 54206.13 69633.25
GreatSQL(144G) 857.28 1327.67 1767.78 2660.8 3148.06 GreatSQL(144G) 17145.52 26553.48 35355.47 53215.89 62961.17
GreatSQL(192G) 1406.86 1316.02 2144.17 4114.55 3310.67 GreatSQL(192G) 28137.19 26320.43 42883.45 82291 66213.47
GreatSQL-thdpool(192G) 1391.2 1247.93 2085.81 4053.76 3113.97 GreatSQL-thdpool(192G) 27823.9 24958.68 41716.16 81075.21 62279.48

2.6 MySQL不同ibp下的數據

MySQL
TPS 8th 16th 32th 64th 128th QPS 8th 16th 32th 64th 128th
MySQL(48G) 686.14 846.5 915.15 1073.95 1439.29 MySQL(48G) 13722.8 16929.94 18303.03 21479 28785.7
MySQL(96G) 751.7 986.11 1218.87 1778.67 2065.69 MySQL(96G) 15034.11 19722.27 24377.47 35573.39 41313.8
MySQL(144G) 857.05 1149.79 2038.3 2516.41 2510.15 MySQL(144G) 17140.96 22995.73 40765.95 50328.29 50202.93
MySQL(192G) 1367.31 2629.75 2940.51 2687.48 2797.06 MySQL(192G) 27346.18 52595.01 58810.18 53749.63 55941.29

image-20220908214940963

測試環境&測試模式

3.1 測試工具

sysbench

/usr/local/bin/sysbench --version
sysbench 1.1.0

P.S,該版本是樓方鑫修改後的,增加了99.9%的RT統計值,例如:

[ 1s ] thds: 128 tps: 10285.06 qps: 208112.71 (r/w/o: 145769.21/41646.36/20697.15) lat (ms,99%,99%,99.9%): 24.83/24.83/28.67 err/s: 0.00 reconn/s: 0.00
[ 2s ] thds: 128 tps: 9968.88 qps: 199013.18 (r/w/o: 139399.13/39676.28/19937.76) lat (ms,99%,99%,99.9%): 20.00/20.00/24.38 err/s: 0.00 reconn/s: 0.00
[ 3s ] thds: 128 tps: 10214.11 qps: 204613.28 (r/w/o: 143162.59/41022.47/20428.22) lat (ms,99%,99%,99.9%): 19.29/19.29/23.10 err/s: 0.00 reconn/s: 0.00
[ 4s ] thds: 128 tps: 10227.68 qps: 204402.77 (r/w/o: 143127.62/40819.79/20455.37) lat (ms,99%,99%,99.9%): 17.95/17.95/20.00 err/s: 0.00 reconn/s: 0.00
[ 5s ] thds: 128 tps: 10466.08 qps: 209233.51 (r/w/o: 146497.06/41804.30/20932.15) lat (ms,99%,99%,99.9%): 19.29/19.29/21.11 err/s: 0.00 reconn/s: 0.00

3.2 測試模式

  • 利用sysbench生成64個表,每個表1250萬條記錄。
  • 資料庫總大小約191G。
  • sysbench採用 oltp_read_write 模式。
  • innodb_flush_method = O_DIRECT_NO_FSYNC。
  • GreatSQL在需要時才開啟thread pool,MySQL不支持thread pool。
  • 預設關閉InnoDB PQ。
  • 因為沒有額外測試機,所以採用本地socket方式連接,順便關閉網路監聽設置。
  • 測試資源有限,所以只測試單機模式,沒有開啟MGR。

3.3 測試機硬體配置

  • 最大物理記憶體:376G,但資料庫分配IBP時分別為48G、96G、144G、192G,沒有將物理記憶體全部耗盡。
  • 磁碟:Dell NVMe SSD
$ nvme list | grep nvme1
/dev/nvme1n1          90L0A019TAHR        
Dell Express Flash CD5 3.84T SFF         1     
2.86  TB /   3.84  TB    512   B +  0 B   1.1.1
  • 文件系統、ioscheduler
$ df -hT | grep nvme1
/dev/nvme1n1p1 xfs       3.5T  2.9T  706G  81% /data_nvme1n1p1

$ cat /sys/block/nvme1n1/queue/scheduler
[none] mq-deadline kyber bfq
  • CPU
Architecture:        x86_64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Little Endian
CPU(s):              176
On-line CPU(s) list: 0-175
Thread(s) per core:  2
Core(s) per socket:  22
Socket(s):           4
NUMA node(s):        4
Vendor ID:           GenuineIntel
BIOS Vendor ID:      Intel
CPU family:          6
Model:               85
Model name:          Intel(R) Xeon(R) Gold 6238 CPU @ 2.10GHz
BIOS Model name:     Intel(R) Xeon(R) Gold 6238 CPU @ 2.10GHz
Stepping:            7
CPU MHz:             2800.924
CPU max MHz:         3700.0000
CPU min MHz:         1000.0000
BogoMIPS:            4200.00
L1d cache:           32K
L1i cache:           32K
L2 cache:            1024K
L3 cache:            30976K
NUMA node0 CPU(s):   0,4,8,12,16,20,24,28,32,36,40,44,48,52,56,60,64,68,72,76,80,84,88,92,96,100,104,108,112,116,120,124,128,132,136,140,144,148,152,156,160,164,168,172
NUMA node1 CPU(s):   1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61,65,69,73,77,81,85,89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173
NUMA node2 CPU(s):   2,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,66,70,74,78,82,86,90,94,98,102,106,110,114,118,122,126,130,134,138,142,146,150,154,158,162,166,170,174
NUMA node3 CPU(s):   3,7,11,15,19,23,27,31,35,39,43,47,51,55,59,63,67,71,75,79,83,87,91,95,99,103,107,111,115,119,123,127,131,135,139,143,147,151,155,159,163,167,171,175
Flags:               fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc art arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single intel_ppin ssbd mba ibrs ibpb stibp ibrs_enhanced fsgsbase tsc_adjust bmi1 avx2 smep bmi2 erms invpcid cqm mpx rdt_a avx512f avx512dq rdseed adx smap clflushopt clwb intel_pt avx512cd avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts pku ospke avx512_vnni md_clear flush_l1d arch_capabilities

3.4 資料庫配置選項參數

[mysqld]
skip-networking
lower_case_table_names = 1
character-set-server = UTF8MB4
skip_name_resolve = 1
default_time_zone = "+8:00"

#performance setttings
lock_wait_timeout = 3600
open_files_limit    = 65535
back_log = 1024
max_connections = 1024
max_connect_errors = 1000000
table_open_cache = 1024
table_definition_cache = 1024
thread_stack = 512K
sort_buffer_size = 4M
join_buffer_size = 4M
read_buffer_size = 8M
read_rnd_buffer_size = 4M
bulk_insert_buffer_size = 64M
thread_cache_size = 768
interactive_timeout = 600
wait_timeout = 600
tmp_table_size = 32M
max_heap_table_size = 32M

#log settings
log_timestamps = SYSTEM
log_error = error.log
log_error_verbosity = 3
slow_query_log = 1
log_slow_extra = 1
#log_slow_verbosity = FULL
slow_query_log_file = slow.log
long_query_time = 0.01
log_queries_not_using_indexes = 1
log_throttle_queries_not_using_indexes = 60
min_examined_row_limit = 0
log_slow_admin_statements = 1
log_slow_slave_statements = 1
log_bin = binlog

binlog_format = ROW
sync_binlog = 1
binlog_cache_size = 4M
max_binlog_cache_size = 2G
max_binlog_size = 1G
binlog_rows_query_log_events = 1
binlog_expire_logs_seconds = 604800
#binlog_expire_logs_auto_purge = 1
binlog_checksum = CRC32
gtid_mode = ON
enforce_gtid_consistency = TRUE

#myisam settings
key_buffer_size = 32M
myisam_sort_buffer_size = 128M

#replication settings
#master_info_repository = TABLE
#relay_log_info_repository = TABLE
relay_log_recovery = 1
slave_parallel_type = LOGICAL_CLOCK
slave_parallel_workers = 2
binlog_transaction_dependency_tracking = WRITESET
slave_preserve_commit_order = 1
slave_checkpoint_period = 2

#innodb settings
transaction_isolation = REPEATABLE-READ
innodb_buffer_pool_size = 2G
innodb_buffer_pool_instances = 8
innodb_data_file_path = ibdata1:12M:autoextend
innodb_flush_log_at_trx_commit = 1
innodb_log_buffer_size = 32M
innodb_log_file_size = 2G
innodb_log_files_in_group = 3
innodb_doublewrite_files = 2
innodb_max_undo_log_size = 4G
innodb_io_capacity = 400000
innodb_io_capacity_max = 800000
innodb_open_files = 65534
#本次測試採用O_DIRECT_NO_FSYNC模式
innodb_flush_method = O_DIRECT_NO_FSYNC
innodb_lru_scan_depth = 4000
innodb_lock_wait_timeout = 10
innodb_rollback_on_timeout = 1
innodb_print_all_deadlocks = 1
innodb_online_alter_log_max_size = 4G
innodb_print_ddl_logs = 0
innodb_status_file = 1
innodb_status_output = 0
innodb_status_output_locks = 1
innodb_sort_buffer_size = 67108864
#innodb_thread_concurrency = 176
#innodb_spin_wait_delay = 3
#innodb_sync_spin_loops = 10

#innodb monitor settings
innodb_monitor_enable = "module_innodb"
innodb_monitor_enable = "module_server"
innodb_monitor_enable = "module_dml"
innodb_monitor_enable = "module_ddl"
innodb_monitor_enable = "module_trx"
innodb_monitor_enable = "module_os"
innodb_monitor_enable = "module_purge"
innodb_monitor_enable = "module_log"
innodb_monitor_enable = "module_lock"
innodb_monitor_enable = "module_buffer"
innodb_monitor_enable = "module_index"
innodb_monitor_enable = "module_ibuf_system"
innodb_monitor_enable = "module_buffer_page"
innodb_monitor_enable = "module_adaptive_hash"

#pfs settings
performance_schema = 1
#performance_schema_instrument = '%memory%=on'
performance_schema_instrument = '%lock%=on'

#thread pool,需要開啟thread pool時才取消下麵兩行註釋
#thread_handling = 'pool-of-thread'
#thread_pool_stall_limit = 50


您的分享是我們最大的動力!

-Advertisement-
Play Games
更多相關文章
  • 大家好,我是棧長。 今天又是一年一度的中秋節了,祝大家節日快樂啊,給大家通報一則消息,Spring Cloud 2021.0.4 最新版發佈了,來看下最新的 Spring Cloud 版本情況: Maven 依賴給大家奉上: <dependencyManagement> <dependencies> ...
  • 單鏈表實現約瑟夫環問題 約瑟夫環 這裡建議使用迴圈單鏈表 代碼實現(c語言) #include<stdio.h> #include<stdlib.h> typedef struct node{ int data; struct node *next; }Node; void ysflb(int n, ...
  • ###快速上手SSM(Spring,SpringMVC,Mybatis)框架整合項目 環境要求: IDEA MySQL 8.0.25 Tomcat 9 Maven 3.6 資料庫環境: 創建一個存放書籍數據的資料庫表 CREATE DATABASE `ssmbooks`; USE `ssmbooks ...
  • Django框架(九) cookie與session簡介 網址的發展史: 1、起初網站都沒有保存用戶功能的需求,所有用戶訪問返回的結果都是一樣的。 比如:新聞網頁,博客網頁,小說... (這些網頁是不需要登錄後才能訪問的,每個人訪問的結果都一樣) 2、後來出現了一些需要保存用戶信息的網站 比如:支付 ...
  • 由於本文需要有一定的Stream基礎,所以如果不懂什麼是Stream的同學請移步:Java Stream入門 操作分類 graph LR 操作分類 中間操作 終端操作 操作分類 中間操作 有狀態 中間操作 無狀態 短路 終端操作 非短路 終端操作 中間操作只進行操作的記錄,而實際的操作是由終端操作來 ...
  • 這兩天在對一些ORM進行性能測試(涉及SqlSugar、FreeSql、Fast.Framework、Dapper.LiteSql),測試用的是Winform程式,別人第一眼看到我的程式,說,你這測試沒意義! 可能我的測試程式的某些地方寫的比較變態吧,但我認為有現實意義,並且網上有相關網站崩潰問題的 ...
  • 參考鏈接:https://www.systutorials.com/docs/linux/man/7-netlink/ #1. 監聽Netlink消息類型示例 Netlink是用戶程式與內核通信的socket方法,通過Netlink可以獲得修改內核的配置,常見的有獲得介面的IP地址列表、更改路由表或 ...
  • 0. 前言 可以臨時設置,也可以修改配置文件 1. 修改配置文件 # 打開 配置IP的文件 路徑如下 sudo vi /etc/netplan/01-network-manager-all.yaml 1.1 輸入(修改)以下內容 # This is the network config writte ...
一周排行
    -Advertisement-
    Play Games
  • C#TMS系統代碼-基礎頁面BaseCity學習 本人純新手,剛進公司跟領導報道,我說我是java全棧,他問我會不會C#,我說大學學過,他說這個TMS系統就給你來管了。外包已經把代碼給我了,這幾天先把增刪改查的代碼背一下,說不定後面就要趕鴨子上架了 Service頁面 //using => impo ...
  • 委托與事件 委托 委托的定義 委托是C#中的一種類型,用於存儲對方法的引用。它允許將方法作為參數傳遞給其他方法,實現回調、事件處理和動態調用等功能。通俗來講,就是委托包含方法的記憶體地址,方法匹配與委托相同的簽名,因此通過使用正確的參數類型來調用方法。 委托的特性 引用方法:委托允許存儲對方法的引用, ...
  • 前言 這幾天閑來沒事看看ABP vNext的文檔和源碼,關於關於依賴註入(屬性註入)這塊兒產生了興趣。 我們都知道。Volo.ABP 依賴註入容器使用了第三方組件Autofac實現的。有三種註入方式,構造函數註入和方法註入和屬性註入。 ABP的屬性註入原則參考如下: 這時候我就開始疑惑了,因為我知道 ...
  • C#TMS系統代碼-業務頁面ShippingNotice學習 學一個業務頁面,ok,領導開完會就被裁掉了,很突然啊,他收拾東西的時候我還以為他要旅游提前請假了,還在尋思為什麼回家連自己買的幾箱飲料都要叫跑腿帶走,怕被偷嗎?還好我在他開會之前拿了兩瓶芬達 感覺感覺前面的BaseCity差不太多,這邊的 ...
  • 概述:在C#中,通過`Expression`類、`AndAlso`和`OrElse`方法可組合兩個`Expression<Func<T, bool>>`,實現多條件動態查詢。通過創建表達式樹,可輕鬆構建複雜的查詢條件。 在C#中,可以使用AndAlso和OrElse方法組合兩個Expression< ...
  • 閑來無聊在我的Biwen.QuickApi中實現一下極簡的事件匯流排,其實代碼還是蠻簡單的,對於初學者可能有些幫助 就貼出來,有什麼不足的地方也歡迎板磚交流~ 首先定義一個事件約定的空介面 public interface IEvent{} 然後定義事件訂閱者介面 public interface I ...
  • 1. 案例 成某三甲醫預約系統, 該項目在2024年初進行上線測試,在正常運行了兩天後,業務系統報錯:The connection pool has been exhausted, either raise MaxPoolSize (currently 800) or Timeout (curren ...
  • 背景 我們有些工具在 Web 版中已經有了很好的實踐,而在 WPF 中重新開發也是一種費時費力的操作,那麼直接集成則是最省事省力的方法了。 思路解釋 為什麼要使用 WPF?莫問為什麼,老 C# 開發的堅持,另外因為 Windows 上已經裝了 Webview2/edge 整體打包比 electron ...
  • EDP是一套集組織架構,許可權框架【功能許可權,操作許可權,數據訪問許可權,WebApi許可權】,自動化日誌,動態Interface,WebApi管理等基礎功能於一體的,基於.net的企業應用開發框架。通過友好的編碼方式實現數據行、列許可權的管控。 ...
  • .Net8.0 Blazor Hybird 桌面端 (WPF/Winform) 實測可以完整運行在 win7sp1/win10/win11. 如果用其他工具打包,還可以運行在mac/linux下, 傳送門BlazorHybrid 發佈為無依賴包方式 安裝 WebView2Runtime 1.57 M ...