SlideShare a Scribd company logo
Using Control Theory to Keep
Compactions Under Control
Glauber Costa - VP of Field Engineering, ScyllaDB
WEBINAR
Glauber Costa
2
Glauber Costa is the VP of Field Engineering at ScyllaDB.
He shares his time between the engineering department
working on upcoming Scylla features and helping
customers succeed.
Before ScyllaDB, Glauber worked with Virtualization in the
Linux Kernel for 10 years with contributions ranging from
the Xen Hypervisor to all sorts of guest functionality and
containers
3
+ Next-generation NoSQL database
+ Drop-in replacement for Cassandra
+ 10X the performance & low tail latency
+ Open source and enterprise editions
+ Founded by the creators of KVM hypervisor
+ HQs: Palo Alto, CA; Herzelia, Israel
+ Scylla Summit 2018 November 6-7, SF Bay
About ScyllaDB
Join real-time big-data database developers and users from start-ups
and leading enterprises from around the globe for two days of sharing
ideas, hearing innovative use cases, and getting practical tips and tricks
from your peers and NoSQL gurus.
What are compactions ?
5
Scylla’s write path:
5
Writes
commit log
compaction
6
Compaction Strategy
+ Which sstables to compact, and when?
+ This is called the compaction strategy
+ The goal of the strategy is low amplification:
+ Avoid read requests needing many sstables: read amplification
+ Avoid overwritten/deleted/expired data staying on disk.
+ Avoid excessive temporary disk space needs: space amplification
+ Avoid compacting the same data again and again : write amplification
7
The main compaction strategies
+ Size Tiered Compaction Strategy
+ compact SSTables with roughly the same size together
+ Leveled Compaction Strategy
+ compact SSTables keeping them in different levels that are exponentially bigger
+ Time Window Compaction Strategy
+ Each user-defined time window has a single SSTable
+ Major, or manual compaction
+ compacts everything in a single* SSTable
8
The main compaction strategies
+ Size Tiered Compaction Strategy
+ compact SSTables with roughly the same size together
+ Leveled Compaction Strategy
+ compact SSTables keeping them in different levels that are exponentially bigger
+ Time Window Compaction Strategy
+ Each user-defined time window has a single SSTable
+ Major, or manual compaction
+ compacts everything in a single* SSTable
* see next slide
9
Compactions in Scylla
+ Because all data is sharded, so are SSTables
+ and as a result, so are compactions
+ in a system with 64 vCPUS - expect 64 SSTables after a major compaction
+ same logic for LeveledCompactionStrategy for amount of tables in each level.
Impact of compactions
10
+ Compaction too slow: reads will touch from many SSTables and be slower.
+ Compactions too fast : foreground workload will be disrupted.
Impact of compactions
11
+ Compaction too slow: reads will touch from many SSTables and be slower.
+ Compactions too fast : foreground workload will be disrupted.
+ Common solutions is to use limits. Ex: Apache Cassandra
+ “Don’t allow compactions to run at more than 300 MB/s”
+ But how to find that number?
+ But what if the workload changes?
+ But what if there is idle time now?
Impact of compactions
12
+ Compaction too slow: reads will touch from many SSTables and be slower.
+ Compactions too fast : foreground workload will be disrupted.
+ Common solutions is to use limits. Ex: Apache Cassandra
+ “Don’t allow compactions to run at more than 300 MB/s”
+ But how to find that number?
+ But what if the workload changes?
+ But what if there is idle time now?
+ Another solution is to determine ratios. Ex: ScyllaDB until 2.2
+ “Don’t allow compactions to use more than 20% of storage bandwidth/CPU”
+ Much better, adapts automatically to resource capacity, use idle time efficiently
+ But no temporal knowledge.
Compactions over time
13
Compactions run. Limited impact,
but still impact
Compactions over time
14
All shards are compacting here Almost no shards are
compacting here
What is Control Theory ?
15
+ Open-loop control system
+ there is some input, a function is applied, there is an output.
+ ex: toaster
+ Closed-loop control systems
+ We want the world to be in a particular state.
+ The current state of the world is fed-back to the control system
+ The control system acts to bring the system back to the goal
Feedback Control Systems
16
1. Measure the state of the world
2. Transfer function
3. Actuator
Measuring - current state of all SSTables
17
Partial New SSTable Size
Static SSTable Size
SSTable Uncompacted Size
SSTable Uncompacted Size
Partial compacted
SSTable Size
Actuators - Schedulers
18
Query
Commitlog
Compaction
Queue
Queue
Queue
Userspace
I/O
Scheduler
Storage
Max useful disk concurrency
I/O queued in FS/deviceNo queues
Transfer Function - Backlog
19
+ Each compaction strategy does a different amount of work
+ For each compaction strategy we determine when there is no more work to be done.
+ Examples:
+ SizeTiered: there is only one SSTable in the system.
+ TimeWindow: there is only one SSTable per Time Window.
+ The backlog is: how many bytes I expect to write to reach the state of zero backlog ?
+ Controller output: f(B)
+ proportional function
Transfer Function - Backlog
20
+ Each compaction strategy does a different amount of work
+ For each compaction strategy we determine when there is no more work to be done.
+ Examples:
+ SizeTiered: there is only one SSTable in the system.
+ TimeWindow: there is only one SSTable per Time Window.
+ The backlog is: how many bytes I expect to write to reach the state of zero backlog ?
+ Controller output: f(B)
+ proportional function
+ This is a self-regulating system:
+ more compaction shares = less new writes = less compaction backlog
+ less compaction shares = more new writes = more compaction backlog
SizeTiered Backlog example
21
SizeTiered Backlog
22
+ each byte that is written now is rewritten T times, where T is the number of tiers
+ In SizeTiered, tiers are proportinal to SSTable Sizes.
SizeTiered Backlog
23
+ each byte that is written now is rewritten T times, where T is the number of tiers
+ In SizeTiered, tiers are proportinal to SSTable Sizes.
+ Number of tiers is roughly proportional to the log of this SSTable contribution to the total size
+ Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB
+ log4(20 / 1) ~ 2
+ log4(20 / 4) ~ 1
SizeTiered Backlog
24
+ each byte that is written now is rewritten T times, where T is the number of tiers
+ In SizeTiered, tiers are proportinal to SSTable Sizes.
+ Number of tiers is roughly proportional to the log of this SSTable contribution to the total size
+ Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB
+ log4(20 / 1) ~ 2
+ log4(20 / 4) ~ 1
+ Backlog for one SSTable is its size, times the backlog per byte:
+ B = SSTableSize * log4(TableSize / SSTableSize)
SizeTiered Backlog
25
+ each byte that is written now is rewritten T times, where T is the number of tiers
+ In SizeTiered, tiers are proportinal to SSTable Sizes.
+ Number of tiers is roughly proportional to the log of this SSTable contribution to the total size
+ Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB
+ log4(20 / 1) ~ 2
+ log4(20 / 4) ~ 1
+ Backlog for one SSTable is its size, times the backlog per byte:
+ B = SSTableSize * log4(TableSize / SSTableSize)
+ Backlog for the Entire Table is the Sum of all backlogs for that SSTable.
Results: before vs after
26
Results: throughput vs CPU
27
% CPU time used by Compactions
Throughput
Results, changing workload
28
28
Workload changes:
- automatic adjustment
- new equilibrium
Results - impact on latency
29
2929
2ms : 99.9 % latencies at 100 % load
< 2ms : 99 % latencies,
1ms : 95 % latencies.
30
Q&A
Stay in touch
Join us at Scylla Summit 2018
Pullman San Francisco Bay Hotel | November 6-7
scylladb.com/scylla-summit-2018
glauber@scylladb.com
@ScyllaDB
@glcst
United States
1900 Embarcadero Road
Palo Alto, CA 94303
Israel
11 Galgalei Haplada
Herzelia, Israel
www.scylladb.com
@scylladb
Thank You!

More Related Content

PPTX
Lightweight Transactions in Scylla versus Apache Cassandra
PDF
Webinar: Does it Still Make Sense to do Big Data with Small Nodes?
PDF
TechTalk: Reduce Your Storage Footprint with a Revolutionary New Compaction S...
PDF
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
PDF
The Do’s and Don’ts of Benchmarking Databases
PDF
Running a DynamoDB-compatible Database on Managed Kubernetes Services
PDF
Comparing Apache Cassandra 4.0, 3.0, and ScyllaDB
PDF
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla
Lightweight Transactions in Scylla versus Apache Cassandra
Webinar: Does it Still Make Sense to do Big Data with Small Nodes?
TechTalk: Reduce Your Storage Footprint with a Revolutionary New Compaction S...
NoSQL and NewSQL: Tradeoffs between Scalable Performance & Consistency
The Do’s and Don’ts of Benchmarking Databases
Running a DynamoDB-compatible Database on Managed Kubernetes Services
Comparing Apache Cassandra 4.0, 3.0, and ScyllaDB
Scylla Summit 2016: Analytics Show Time - Spark and Presto Powered by Scylla

What's hot (20)

PDF
How to Build a Scylla Database Cluster that Fits Your Needs
PPTX
Seastar Summit 2019 Keynote
PDF
Under the Hood of a Shard-per-Core Database Architecture
PDF
Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...
PDF
The True Cost of NoSQL DBaaS Options
PDF
Addressing the High Cost of Apache Cassandra
PDF
Measuring Database Performance on Bare Metal AWS Instances
PDF
Scylla Virtual Workshop 2020
PDF
Critical Attributes for a High-Performance, Low-Latency Database
PDF
Introducing Scylla Cloud
PDF
AdGear Use Case with Scylla - 1M Queries Per Second with Single-Digit Millise...
PDF
Scylla Summit 2016: Compose on Containing the Database
PPTX
Cassandra vs. ScyllaDB: Evolutionary Differences
PDF
Renegotiating the boundary between database latency and consistency
PDF
How to achieve no compromise performance and availability
PDF
Introducing Scylla Manager: Cluster Management and Task Automation
PDF
Introducing Scylla Open Source 4.0
PDF
Back to the future with C++ and Seastar
PPTX
Scylla Summit 2018: Keynote - 4 Years of Scylla
PDF
Demystifying the Distributed Database Landscape
How to Build a Scylla Database Cluster that Fits Your Needs
Seastar Summit 2019 Keynote
Under the Hood of a Shard-per-Core Database Architecture
Numberly on Joining Billions of Rows in Seconds: Replacing MongoDB and Hive w...
The True Cost of NoSQL DBaaS Options
Addressing the High Cost of Apache Cassandra
Measuring Database Performance on Bare Metal AWS Instances
Scylla Virtual Workshop 2020
Critical Attributes for a High-Performance, Low-Latency Database
Introducing Scylla Cloud
AdGear Use Case with Scylla - 1M Queries Per Second with Single-Digit Millise...
Scylla Summit 2016: Compose on Containing the Database
Cassandra vs. ScyllaDB: Evolutionary Differences
Renegotiating the boundary between database latency and consistency
How to achieve no compromise performance and availability
Introducing Scylla Manager: Cluster Management and Task Automation
Introducing Scylla Open Source 4.0
Back to the future with C++ and Seastar
Scylla Summit 2018: Keynote - 4 Years of Scylla
Demystifying the Distributed Database Landscape
Ad

Similar to Webinar: Using Control Theory to Keep Compactions Under Control (20)

PDF
Scylla Compaction Strategies
PPTX
Balancing Compaction Principles and Practices
PPTX
Manage your compactions before they manage you!
PDF
Using ScyllaDB for Real-Time Write-Heavy Workloads
PDF
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
PPTX
How Incremental Compaction Reduces Your Storage Footprint
PDF
Object Compaction in Cloud for High Yield
PDF
Scylla Summit 2017: How to Ruin Your Workload's Performance by Choosing the W...
PDF
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
PDF
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
PPTX
Using Time Window Compaction Strategy For Time Series Workloads
PPTX
High-Load Storage of Users’ Actions with ScyllaDB and HDDs
PPTX
Designing data intensive applications
PDF
Compaction, Compaction Everywhere
PDF
Using ScyllaDB for Real-Time Read-Heavy Workloads.pdf
PDF
Cassandra 2.1 boot camp, Compaction
PPT
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
PDF
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
PPTX
Scylla Summit 2022: Scylla 5.0 New Features, Part 1
PPTX
HBaseCon 2013: Compaction Improvements in Apache HBase
Scylla Compaction Strategies
Balancing Compaction Principles and Practices
Manage your compactions before they manage you!
Using ScyllaDB for Real-Time Write-Heavy Workloads
Database Performance at Scale Masterclass: Workload Characteristics by Felipe...
How Incremental Compaction Reduces Your Storage Footprint
Object Compaction in Cloud for High Yield
Scylla Summit 2017: How to Ruin Your Workload's Performance by Choosing the W...
C* Summit 2013: Time is Money Jake Luciani and Carl Yeksigian
[Cassandra summit Tokyo, 2015] Cassandra 2015 最新情報 by ジョナサン・エリス(Jonathan Ellis)
Using Time Window Compaction Strategy For Time Series Workloads
High-Load Storage of Users’ Actions with ScyllaDB and HDDs
Designing data intensive applications
Compaction, Compaction Everywhere
Using ScyllaDB for Real-Time Read-Heavy Workloads.pdf
Cassandra 2.1 boot camp, Compaction
Key Challenges in Cloud Computing and How Yahoo! is Approaching Them
Object Storage in ScyllaDB by Ran Regev, ScyllaDB
Scylla Summit 2022: Scylla 5.0 New Features, Part 1
HBaseCon 2013: Compaction Improvements in Apache HBase
Ad

More from ScyllaDB (20)

PDF
Understanding The True Cost of DynamoDB Webinar
PDF
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
PDF
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
PDF
New Ways to Reduce Database Costs with ScyllaDB
PDF
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
PDF
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
PDF
Leading a High-Stakes Database Migration
PDF
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
PDF
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
PDF
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
PDF
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
PDF
ScyllaDB: 10 Years and Beyond by Dor Laor
PDF
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
PDF
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
PDF
Vector Search with ScyllaDB by Szymon Wasik
PDF
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
PDF
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
PDF
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
PDF
Lessons Learned from Building a Serverless Notifications System by Srushith R...
PDF
A Dist Sys Programmer's Journey into AI by Piotr Sarna
Understanding The True Cost of DynamoDB Webinar
Database Benchmarking for Performance Masterclass: Session 2 - Data Modeling ...
Database Benchmarking for Performance Masterclass: Session 1 - Benchmarking F...
New Ways to Reduce Database Costs with ScyllaDB
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Powering a Billion Dreams: Scaling Meesho’s E-commerce Revolution with Scylla...
Leading a High-Stakes Database Migration
Achieving Extreme Scale with ScyllaDB: Tips & Tradeoffs
Securely Serving Millions of Boot Artifacts a Day by João Pedro Lima & Matt ...
How Agoda Scaled 50x Throughput with ScyllaDB by Worakarn Isaratham
How Yieldmo Cut Database Costs and Cloud Dependencies Fast by Todd Coleman
ScyllaDB: 10 Years and Beyond by Dor Laor
Reduce Your Cloud Spend with ScyllaDB by Tzach Livyatan
Migrating 50TB Data From a Home-Grown Database to ScyllaDB, Fast by Terence Liu
Vector Search with ScyllaDB by Szymon Wasik
Workload Prioritization: How to Balance Multiple Workloads in a Cluster by Fe...
Two Leading Approaches to Data Virtualization, and Which Scales Better? by Da...
Scaling a Beast: Lessons from 400x Growth in a High-Stakes Financial System b...
Lessons Learned from Building a Serverless Notifications System by Srushith R...
A Dist Sys Programmer's Journey into AI by Piotr Sarna

Recently uploaded (20)

PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
Machine learning based COVID-19 study performance prediction
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Empathic Computing: Creating Shared Understanding
PPTX
Big Data Technologies - Introduction.pptx
PPT
Teaching material agriculture food technology
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Encapsulation theory and applications.pdf
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PPTX
sap open course for s4hana steps from ECC to s4
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
“AI and Expert System Decision Support & Business Intelligence Systems”
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Machine learning based COVID-19 study performance prediction
Encapsulation_ Review paper, used for researhc scholars
Understanding_Digital_Forensics_Presentation.pptx
Empathic Computing: Creating Shared Understanding
Big Data Technologies - Introduction.pptx
Teaching material agriculture food technology
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Encapsulation theory and applications.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
Chapter 3 Spatial Domain Image Processing.pdf
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
sap open course for s4hana steps from ECC to s4

Webinar: Using Control Theory to Keep Compactions Under Control

  • 1. Using Control Theory to Keep Compactions Under Control Glauber Costa - VP of Field Engineering, ScyllaDB WEBINAR
  • 2. Glauber Costa 2 Glauber Costa is the VP of Field Engineering at ScyllaDB. He shares his time between the engineering department working on upcoming Scylla features and helping customers succeed. Before ScyllaDB, Glauber worked with Virtualization in the Linux Kernel for 10 years with contributions ranging from the Xen Hypervisor to all sorts of guest functionality and containers
  • 3. 3 + Next-generation NoSQL database + Drop-in replacement for Cassandra + 10X the performance & low tail latency + Open source and enterprise editions + Founded by the creators of KVM hypervisor + HQs: Palo Alto, CA; Herzelia, Israel + Scylla Summit 2018 November 6-7, SF Bay About ScyllaDB
  • 4. Join real-time big-data database developers and users from start-ups and leading enterprises from around the globe for two days of sharing ideas, hearing innovative use cases, and getting practical tips and tricks from your peers and NoSQL gurus.
  • 5. What are compactions ? 5 Scylla’s write path: 5 Writes commit log compaction
  • 6. 6 Compaction Strategy + Which sstables to compact, and when? + This is called the compaction strategy + The goal of the strategy is low amplification: + Avoid read requests needing many sstables: read amplification + Avoid overwritten/deleted/expired data staying on disk. + Avoid excessive temporary disk space needs: space amplification + Avoid compacting the same data again and again : write amplification
  • 7. 7 The main compaction strategies + Size Tiered Compaction Strategy + compact SSTables with roughly the same size together + Leveled Compaction Strategy + compact SSTables keeping them in different levels that are exponentially bigger + Time Window Compaction Strategy + Each user-defined time window has a single SSTable + Major, or manual compaction + compacts everything in a single* SSTable
  • 8. 8 The main compaction strategies + Size Tiered Compaction Strategy + compact SSTables with roughly the same size together + Leveled Compaction Strategy + compact SSTables keeping them in different levels that are exponentially bigger + Time Window Compaction Strategy + Each user-defined time window has a single SSTable + Major, or manual compaction + compacts everything in a single* SSTable * see next slide
  • 9. 9 Compactions in Scylla + Because all data is sharded, so are SSTables + and as a result, so are compactions + in a system with 64 vCPUS - expect 64 SSTables after a major compaction + same logic for LeveledCompactionStrategy for amount of tables in each level.
  • 10. Impact of compactions 10 + Compaction too slow: reads will touch from many SSTables and be slower. + Compactions too fast : foreground workload will be disrupted.
  • 11. Impact of compactions 11 + Compaction too slow: reads will touch from many SSTables and be slower. + Compactions too fast : foreground workload will be disrupted. + Common solutions is to use limits. Ex: Apache Cassandra + “Don’t allow compactions to run at more than 300 MB/s” + But how to find that number? + But what if the workload changes? + But what if there is idle time now?
  • 12. Impact of compactions 12 + Compaction too slow: reads will touch from many SSTables and be slower. + Compactions too fast : foreground workload will be disrupted. + Common solutions is to use limits. Ex: Apache Cassandra + “Don’t allow compactions to run at more than 300 MB/s” + But how to find that number? + But what if the workload changes? + But what if there is idle time now? + Another solution is to determine ratios. Ex: ScyllaDB until 2.2 + “Don’t allow compactions to use more than 20% of storage bandwidth/CPU” + Much better, adapts automatically to resource capacity, use idle time efficiently + But no temporal knowledge.
  • 13. Compactions over time 13 Compactions run. Limited impact, but still impact
  • 14. Compactions over time 14 All shards are compacting here Almost no shards are compacting here
  • 15. What is Control Theory ? 15 + Open-loop control system + there is some input, a function is applied, there is an output. + ex: toaster + Closed-loop control systems + We want the world to be in a particular state. + The current state of the world is fed-back to the control system + The control system acts to bring the system back to the goal
  • 16. Feedback Control Systems 16 1. Measure the state of the world 2. Transfer function 3. Actuator
  • 17. Measuring - current state of all SSTables 17 Partial New SSTable Size Static SSTable Size SSTable Uncompacted Size SSTable Uncompacted Size Partial compacted SSTable Size
  • 19. Transfer Function - Backlog 19 + Each compaction strategy does a different amount of work + For each compaction strategy we determine when there is no more work to be done. + Examples: + SizeTiered: there is only one SSTable in the system. + TimeWindow: there is only one SSTable per Time Window. + The backlog is: how many bytes I expect to write to reach the state of zero backlog ? + Controller output: f(B) + proportional function
  • 20. Transfer Function - Backlog 20 + Each compaction strategy does a different amount of work + For each compaction strategy we determine when there is no more work to be done. + Examples: + SizeTiered: there is only one SSTable in the system. + TimeWindow: there is only one SSTable per Time Window. + The backlog is: how many bytes I expect to write to reach the state of zero backlog ? + Controller output: f(B) + proportional function + This is a self-regulating system: + more compaction shares = less new writes = less compaction backlog + less compaction shares = more new writes = more compaction backlog
  • 22. SizeTiered Backlog 22 + each byte that is written now is rewritten T times, where T is the number of tiers + In SizeTiered, tiers are proportinal to SSTable Sizes.
  • 23. SizeTiered Backlog 23 + each byte that is written now is rewritten T times, where T is the number of tiers + In SizeTiered, tiers are proportinal to SSTable Sizes. + Number of tiers is roughly proportional to the log of this SSTable contribution to the total size + Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB + log4(20 / 1) ~ 2 + log4(20 / 4) ~ 1
  • 24. SizeTiered Backlog 24 + each byte that is written now is rewritten T times, where T is the number of tiers + In SizeTiered, tiers are proportinal to SSTable Sizes. + Number of tiers is roughly proportional to the log of this SSTable contribution to the total size + Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB + log4(20 / 1) ~ 2 + log4(20 / 4) ~ 1 + Backlog for one SSTable is its size, times the backlog per byte: + B = SSTableSize * log4(TableSize / SSTableSize)
  • 25. SizeTiered Backlog 25 + each byte that is written now is rewritten T times, where T is the number of tiers + In SizeTiered, tiers are proportinal to SSTable Sizes. + Number of tiers is roughly proportional to the log of this SSTable contribution to the total size + Ex: 4 SSTables with 1GB, 4 SSTables with 4GB. Total size = 20GB + log4(20 / 1) ~ 2 + log4(20 / 4) ~ 1 + Backlog for one SSTable is its size, times the backlog per byte: + B = SSTableSize * log4(TableSize / SSTableSize) + Backlog for the Entire Table is the Sum of all backlogs for that SSTable.
  • 26. Results: before vs after 26
  • 27. Results: throughput vs CPU 27 % CPU time used by Compactions Throughput
  • 28. Results, changing workload 28 28 Workload changes: - automatic adjustment - new equilibrium
  • 29. Results - impact on latency 29 2929 2ms : 99.9 % latencies at 100 % load < 2ms : 99 % latencies, 1ms : 95 % latencies.
  • 30. 30 Q&A Stay in touch Join us at Scylla Summit 2018 Pullman San Francisco Bay Hotel | November 6-7 scylladb.com/scylla-summit-2018 glauber@scylladb.com @ScyllaDB @glcst
  • 31. United States 1900 Embarcadero Road Palo Alto, CA 94303 Israel 11 Galgalei Haplada Herzelia, Israel www.scylladb.com @scylladb Thank You!