Copyright © 2020 Oracle and/or its affiliates.
MySQL NDB Cluster 8.0,
TPC-H Benchmarks
MySQL Cluster Development
Mikael Ronström
Faster SQL and disk data
• On modern NVMe disk data almost at par with
memory
NDB
Mgmt Server
MySQL Server
NDB
Mgmt Server
MySQL Server
NDB Data Node NDB Data Node
……………………… MySQL App
Load
Balancer
MySQL App
Scalable Cluster Setup for MySQL Cluster 8.0
Latency Optimised Small Cluster Setup for MySQL Cluster 8.0
Computer Computer
Computer
Small Computer
……. n Servers/
VMs/
Containers
2 Servers/
VMs/
Containers
MySQL
App
MySQL
App
MySQL Server
NDB Data Node
NDB Mgm Server
2 Small Servers/
VMs/
Containers
Computer
Small Computer
MySQL Server
NDB Data Node
NDB Mgm Server
Shared Memory Connection Shared Memory Connection
Load
Balancer
TPC-H Improvement in 8.0.20 vs 7.6
(SF=10)
PercentageimprovementwithNDB8.0.20
1
10
100
1000
10000
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
Improvements 8.0.20 vs 7.6.12
TPC-H Latency improvement with
Colocated MySQL Server and NDB Data Node
Percentageimprovementwithcolocation
0
35
70
105
140
TPC-H Queries
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
Colocated improvement
TPC-H Latency improvement with
LatencyOptimisedSpinning
Percentageimprovementwith
LatencyOptimisedSpinning
0
15
30
45
60
TPC-H Queries
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
LatencyOptimisedSpinning
TPC-H Latency Improvement with
Colocation AND LatencyOptimisedSpinning
PercentageimprovementColocated+
LatencyOptimisedSpinning
0
60
120
180
240
300
TPC-H Queries
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
Colocated+LatencyOptimisedSpinning
TPC-H Latency Improvement going from
6 LDMs to 12 LDMs
Percentagechange12LDMsvs6LDMs
-25
0
25
50
75
100
TPC-H Queries
Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
12LDM vs 6 LDM
TPC-H NDB vs InnoDB
2-node HA fully-replicated NDB compared to standalone local InnoDB
PercentagedifferenceNDBvsInnoDB
-1500
0
1500
3000
4500
6000
TPC-H Queries
Q2 Q3 *) Q4 Q5 Q6 Q7 Q8 *) Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22
NDB vs InnoDB
NDB Execution architecture
Parallel Query, 2 Data Node, Read Backup
MySQL Server
MySQL
Connection
Thread
NDB API
Receive
Thread
NDB
Data Node
Receive
Thread
TC
Thread
(Join Exec)
TC
Thread
(Join Exec)
LDM
Thread
Select +
Project
LDM
Thread
Select +
Project
LDM
Thread
Select +
Project
• Single MySQL Connection Thread
• Single NDB API Receive Thread (Per Query)
• 2 TC threads per Node Group
• Network Bandwidth
Potential Bottlenecks for
NDB Parallel Query
• Primary Key lookup = O(1), a few microseconds
• Unique Key lookup = O(1) is 2 Primary Key lookups
• Full table scan = NumPartitions * start_cost + NumRows *
scan_cost
• Partition Pruned Range scan = start_cost + NumRangeRows *
scan_cost
• Range scan not pruned = NumPartitions * start_cost +
NumRangeRows * scan_cost
NDB Query Costs
• Filtering scales almost perfectly
• TPC-H scales to 12 LDMs for most queries
• 24 LDMs brings only change to a few queries, some negative,
some positive
• Future work to push join filtering to TC threads
• Future work to push more functions to LDM threads
• More work on improving NDB Cost Model
Scalability of Parallel Query in NDB 8.0.20

Ndb cluster 80_tpc_h

  • 1.
    Copyright © 2020Oracle and/or its affiliates. MySQL NDB Cluster 8.0, TPC-H Benchmarks MySQL Cluster Development Mikael Ronström
  • 2.
    Faster SQL anddisk data • On modern NVMe disk data almost at par with memory
  • 3.
    NDB Mgmt Server MySQL Server NDB MgmtServer MySQL Server NDB Data Node NDB Data Node ……………………… MySQL App Load Balancer MySQL App Scalable Cluster Setup for MySQL Cluster 8.0
  • 4.
    Latency Optimised SmallCluster Setup for MySQL Cluster 8.0 Computer Computer Computer Small Computer ……. n Servers/ VMs/ Containers 2 Servers/ VMs/ Containers MySQL App MySQL App MySQL Server NDB Data Node NDB Mgm Server 2 Small Servers/ VMs/ Containers Computer Small Computer MySQL Server NDB Data Node NDB Mgm Server Shared Memory Connection Shared Memory Connection Load Balancer
  • 5.
    TPC-H Improvement in8.0.20 vs 7.6 (SF=10) PercentageimprovementwithNDB8.0.20 1 10 100 1000 10000 Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Improvements 8.0.20 vs 7.6.12
  • 6.
    TPC-H Latency improvementwith Colocated MySQL Server and NDB Data Node Percentageimprovementwithcolocation 0 35 70 105 140 TPC-H Queries Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Colocated improvement
  • 7.
    TPC-H Latency improvementwith LatencyOptimisedSpinning Percentageimprovementwith LatencyOptimisedSpinning 0 15 30 45 60 TPC-H Queries Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 LatencyOptimisedSpinning
  • 8.
    TPC-H Latency Improvementwith Colocation AND LatencyOptimisedSpinning PercentageimprovementColocated+ LatencyOptimisedSpinning 0 60 120 180 240 300 TPC-H Queries Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 Colocated+LatencyOptimisedSpinning
  • 9.
    TPC-H Latency Improvementgoing from 6 LDMs to 12 LDMs Percentagechange12LDMsvs6LDMs -25 0 25 50 75 100 TPC-H Queries Q2 Q3 Q4 Q5 Q6 Q7 Q8 Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 12LDM vs 6 LDM
  • 10.
    TPC-H NDB vsInnoDB 2-node HA fully-replicated NDB compared to standalone local InnoDB PercentagedifferenceNDBvsInnoDB -1500 0 1500 3000 4500 6000 TPC-H Queries Q2 Q3 *) Q4 Q5 Q6 Q7 Q8 *) Q9 Q10 Q11 Q12 Q13 Q14 Q15 Q16 Q17 Q18 Q19 Q20 Q21 Q22 NDB vs InnoDB
  • 11.
    NDB Execution architecture ParallelQuery, 2 Data Node, Read Backup MySQL Server MySQL Connection Thread NDB API Receive Thread NDB Data Node Receive Thread TC Thread (Join Exec) TC Thread (Join Exec) LDM Thread Select + Project LDM Thread Select + Project LDM Thread Select + Project
  • 12.
    • Single MySQLConnection Thread • Single NDB API Receive Thread (Per Query) • 2 TC threads per Node Group • Network Bandwidth Potential Bottlenecks for NDB Parallel Query
  • 13.
    • Primary Keylookup = O(1), a few microseconds • Unique Key lookup = O(1) is 2 Primary Key lookups • Full table scan = NumPartitions * start_cost + NumRows * scan_cost • Partition Pruned Range scan = start_cost + NumRangeRows * scan_cost • Range scan not pruned = NumPartitions * start_cost + NumRangeRows * scan_cost NDB Query Costs
  • 14.
    • Filtering scalesalmost perfectly • TPC-H scales to 12 LDMs for most queries • 24 LDMs brings only change to a few queries, some negative, some positive • Future work to push join filtering to TC threads • Future work to push more functions to LDM threads • More work on improving NDB Cost Model Scalability of Parallel Query in NDB 8.0.20