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

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
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
 
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)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
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
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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...
 
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
 
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
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
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
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 

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