SlideShare uma empresa Scribd logo
1 de 18
Fireside
Grade of the Steel
    Thomas Kejser
Grade of the Steel
1. Pick a simple workload

2. Do the naïve thing

3. Tune the … out of it

4. Find the limit

5. Get smart (optional)
Grade of the Steel Examples
• 16M BULK Rows/sec

• 50M rows SELECT (4 x 10Gbit)

• Backup at 6GB/sec

• 1.1M INSERT/sec
Step 1 – Theory and Baseline
Commit                            SQLIO.EXE
            BufferOffset           –t1
                                   –o1
                                   –b60
                            ...
   Slot 1
                           Slot
                                   –kW
     ...
                            n      -fsequential


               Writer             COREINFO.EXE > info.txt
               Queue



            Log Writer
Step 2 – Design Workload

         File 1   FG 1   Table 1


         File 2   FG 2   Table 2
                                   SQLCMD
Stripe




         File 3   FG 3             Threads
                         Table 3




         File X   FG X   Table X
Step 3 – Tune
• Add Files / Tables

                          Theory        Measure
• Thread Sweet spot

• Affinitize I/O

• Placement of Log                 Change
Messages Queues
 Part 1 – Naïve
Problem Statement

       Push                                 Pop


                    Queue Structure
300B                                              Msg
              Msg   Msg      Msg      Msg
msg



                       Ordered
The Naïve Approach
Push                      Pop
• Seek first value page   • Seek last value page
• INSERT a row at page    • DELETE/Output key on page




 Min              Max           Min            Max
                   Msg    Msg   Msg
Why this doesn’t Scale!
                             Root




               Min     Min         Min




         Min    Min   Min    Min         Min   Min
Min                                                  Max
Messages Queues
Part 2 – Getting smart
Summarising the Problem
• Hot stuff
   –   Root
   –   Min page
   –   Max page
   –   Intermediate pages
• Alloc/Dealloc
• BUT: We Must have
  order!
Cooling it down
Allocations - What if?...
Push                         Pop
• Seek first value page      • Seek last value page
• UPDATE Reference Count     • UPDATE Reference Count




 Min                  Max       Min                 Max
                     Msg++     Msg--
Dissipate the Heat

      Last Digit = 0         Last Digit = 1               Last Digit = 2




Min                Max    Min                 Max   Min                Max
Msg--             Msg++   Msg--           Msg++     Msg--             Msg++
Eliminating Thread Contention
                           VERY
                           fast!


  PopSequence++                             PushSequence++



                      Queue Structure

       4          5           6         7        8


                        Ordered
Ring Buffering

PushSequence+=2   PopSequence++                                   PushSequence+=1
    Mod 100          Mod 100                                          Mod 100



                                  MyQ
 Slot:0            Slot:42                  Slot: 97   Slot: 98      Slot: 99
Msg: 200          Msg: 142                  Msg: 197   Msg: 198      Msg: 199


                                  Ordered
Summing it up
• UPDATE instead of
  INSERT/DELETE
• Multi partitions =
  multiple trees
• Ring buffer using modulo
• Sweet spot concurrency

Mais conteúdo relacionado

Semelhante a Fireside fusion talk - message queues (6)

Computing on Encrypted Data
Computing on Encrypted DataComputing on Encrypted Data
Computing on Encrypted Data
 
About memcached
About memcachedAbout memcached
About memcached
 
09_Practical Multicore programming
09_Practical Multicore programming09_Practical Multicore programming
09_Practical Multicore programming
 
Top 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applicationsTop 5 mistakes when writing Spark applications
Top 5 mistakes when writing Spark applications
 
Cache aware hybrid sorter
Cache aware hybrid sorterCache aware hybrid sorter
Cache aware hybrid sorter
 
14 query processing-sorting
14 query processing-sorting14 query processing-sorting
14 query processing-sorting
 

Último

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Último (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUKSpring Boot vs Quarkus the ultimate battle - DevoxxUK
Spring Boot vs Quarkus the ultimate battle - DevoxxUK
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 

Fireside fusion talk - message queues

  • 1. Fireside Grade of the Steel Thomas Kejser
  • 2. Grade of the Steel 1. Pick a simple workload 2. Do the naïve thing 3. Tune the … out of it 4. Find the limit 5. Get smart (optional)
  • 3. Grade of the Steel Examples • 16M BULK Rows/sec • 50M rows SELECT (4 x 10Gbit) • Backup at 6GB/sec • 1.1M INSERT/sec
  • 4. Step 1 – Theory and Baseline Commit SQLIO.EXE BufferOffset –t1 –o1 –b60 ... Slot 1 Slot –kW ... n -fsequential Writer COREINFO.EXE > info.txt Queue Log Writer
  • 5. Step 2 – Design Workload File 1 FG 1 Table 1 File 2 FG 2 Table 2 SQLCMD Stripe File 3 FG 3 Threads Table 3 File X FG X Table X
  • 6. Step 3 – Tune • Add Files / Tables Theory Measure • Thread Sweet spot • Affinitize I/O • Placement of Log Change
  • 7. Messages Queues Part 1 – Naïve
  • 8. Problem Statement Push Pop Queue Structure 300B Msg Msg Msg Msg Msg msg Ordered
  • 9. The Naïve Approach Push Pop • Seek first value page • Seek last value page • INSERT a row at page • DELETE/Output key on page Min Max Min Max Msg Msg Msg
  • 10. Why this doesn’t Scale! Root Min Min Min Min Min Min Min Min Min Min Max
  • 11. Messages Queues Part 2 – Getting smart
  • 12. Summarising the Problem • Hot stuff – Root – Min page – Max page – Intermediate pages • Alloc/Dealloc • BUT: We Must have order!
  • 14. Allocations - What if?... Push Pop • Seek first value page • Seek last value page • UPDATE Reference Count • UPDATE Reference Count Min Max Min Max Msg++ Msg--
  • 15. Dissipate the Heat Last Digit = 0 Last Digit = 1 Last Digit = 2 Min Max Min Max Min Max Msg-- Msg++ Msg-- Msg++ Msg-- Msg++
  • 16. Eliminating Thread Contention VERY fast! PopSequence++ PushSequence++ Queue Structure 4 5 6 7 8 Ordered
  • 17. Ring Buffering PushSequence+=2 PopSequence++ PushSequence+=1 Mod 100 Mod 100 Mod 100 MyQ Slot:0 Slot:42 Slot: 97 Slot: 98 Slot: 99 Msg: 200 Msg: 142 Msg: 197 Msg: 198 Msg: 199 Ordered
  • 18. Summing it up • UPDATE instead of INSERT/DELETE • Multi partitions = multiple trees • Ring buffer using modulo • Sweet spot concurrency