SlideShare a Scribd company logo
1 of 54
Download to read offline
C* Upgrades at Scale
Ajay Upadhyay & Vinay Chella
Data Architects
Who are We??
● Cloud Database Engineering [CDE]
● Providing Cassandra, Dynomite, Elastic
Search and other data stores as a
service
● Ajay Upadhyay
○ Data Architect @ Netflix
● Vinay Chella
○ Data Architect @ Netflix
○ https://www.linkedin.com/in/vinaykumarchella
● About Netflix
● Cassandra @ Netflix
● What is our C* scale ??
● What do we upgrade, Why?
● How does it impact applications and services
● What makes C* upgrades smoother??
● Infrastructure for upgrade
● Online Upgrade process
● Pappy framework
● Migration Hiccups/ Roadblocks
Agenda
4
● Started as DVD rental
● Internet delivery/ streaming of TV shows and movies directly on TVs,
computers, and mobile devices in the United States and internationally
About Netflix
Cassandra @ Netflix
● 90% of streaming data is stored in Cassandra
● Data ranges from customer details to Viewing history to streaming
bookmarks
● High availability, Multi-region resiliency and Active-Active
What is our scale (C* Footprint)
235
What is our scale (C* Footprint) Continue...
7000+
Duration of the upgrade???
What do we upgrade??
● Software
○ Cassandra
○ Priam
○ OS
○ Other sidecars
● Hardware
○ AWS instance types
What do we upgrade, Why?
Continue...
Why new release (C* 2.0)? What’s
wrong with (1.2)?
What do we upgrade, Why?
continues...
● Typically nothing wrong with
current release (in this case 1.2…)
● Pretty stable and few clusters are
still running current release
without any issues
● Still supported by Datastax but
new features and bug fixes are not
being done any more
● End of life cycle
What do we upgrade, Why?
continues...
● Good to be on latest and stable
release
● Lots of great features
● Bug fixes and enhancements / new
features are being only added to
the latest release
Application and service level impact/change
● Before Migration
● During migration
● After migration
Application and service level impact/change
● None, if app is using latest Netflix
OSS components (Astyanax/
BaseServer)
During the upgrade???
What makes C* upgrades smoother
and transparent
How do we certify a binary??
Functionality….
Is any existing functionality broken?
How do we certify a binary for the final upgrade
Simulate PROD
● Use pappy framework to simulate
prod traffic on test clusters
● Soak it, make sure traffic pattern is
same in terms of R/W OPS,
storage and AWS instance type
How do we certify a binary for the final upgrade
Typical usage patterns:
● Read Heavy
● Write Heavy
● STCS
● LCS
● Aggressive TTLs
● Variable Payloads
How do we certify a binary for the final upgrade
continues...
During Upgrade:
● Start upgrading one of the clusters
to new release, keeping same
traffic
● Any issues, get new patch, redo
whole migration
● Process is fully automated, takes
few minutes to couple of hours to
redo entire test
Summary
● Functional validation
● Performance testing
● Load test with routine
maintenance tasks
○ Repair and Compaction
○ Replacement and Restarts
● Key Metrics Used
○ 95th and 99th Latencies
○ Dropped Metrics on C*
○ Exceptions on C*
○ Heap Usage on C*
○ Threads Pending on C*
How do we certify a binary for the final upgrade
continues...
Infrastructure for upgrade...
● Health Monitoring Jobs
● Regular Maintenance Jobs
○ Repairs
○ Compactions
● Upgrades
○ Sizing
○ Instance Types
○ OS
○ Sidecar
○ C*
Infrastructure for upgrade...
Online upgrade process (steps)
Pre-Upgrade:
1. Check for the forgotten files
2. Check for currently running (maintenance) jobs
3. Disable all the maintenance jobs until the duration of upgrade process
a. Compact
b. Repair
c. Terminate
4. Disable Monkeys
5. Download the DSE tarball
6. Make sure that the cluster is healthy before starting upgrade
Online upgrade process (steps)
Upgrade:
● Running binary upgrade of Priam and C* on a node
○ Continue to make sure that the cluster is still healthy
○ Disable node in Eureka
○ Disable thrift, gossip and run nodetool drain
○ Stop Cassandra and Priam
○ Install new C* package (tarball)
○ Make sure the cluster is still healthy
■ Disable/Enable gossip if new node does not see all others vice-versa
○ Verify “nodetool version”
● Make sure the cluster is still healthy before next step
Online upgrade process (steps)
Post-Upgrade:
1. Alter CF settings (for all Keyspace/CF): speculative_retry = 'NONE' and
index_interval = 256
2. Run SSTABLE Upgrade on all nodes (STCS - parallel, LCS - Serial)
3. Enable Chaos Monkey
4. Make sure the cluster is still healthy before considering the upgrade done
Online upgrade process
One node at a time - parallelly in all regions
One zone at a time - parallely in all regions
One zone at a time??
Binary upgrades??
Why not replacements??
Dual Writes - Forklift (Pappy Framework)
● For short lived data and big clusters
● Astyanax - Dual Writes
● C* Forklifter - Pappy Framework
Click of a button (Just 1 button….)
What about performance??
Pappy Framework…..
What is Pappy??
● CDE’s new Test harness framework
● Helps CDE moving fast with load / performance tests
● Netflix homegrown: Governated, well integrated with netflix OSS
infrastructure (Archaius, Servo, Eureka and Karyan)
● Side by side comparison of different performance runs
High level features
● Collects metrics for
○ Various Instance types comparison
○ Varying data models in terms of payload, shard and comparators
○ Different driver(s) versions
● Pluggable architecture enables working with various datastores (Cassandra,
Dyno, ES etc.,)
Architecture
Performance testing...
● More than 10 rounds of performance testing
● Yaml tuning
○ Read heavy - Write heavy
○ Write heavy
○ Read heavy
Test Setup #1
Row Size: 1KB (size-100*cols-10)
Data Size: 30GB (Keys: 20,000,000)
Read: 4K (3.6 K)
Writes: 1 K (700)
Instance: i2.xl (4 CPU, 30 GB RAM)
Nodes: 6
Region: Us-East
Read CL CL_ONE
Write CL CL_ONE
Heap 12 GB / Newgen: 2GB
Test Setup #1 - Results
Test Setup #1 C* 1.2 C* 2.0
ROps 3.1 K - 4.0 K / sec 2.6 - 3.5 K/ sec
WOps 710 /sec 730 /sec
Read 95th 2.25k micro 2.89k micro
Read 99Th 3.6k micro 4.7k micro
Write 95th 720 micro 770 micro
Write 99Th 890 micro 1.01 k micro
Data / Node 30 - 36 GB 30 - 36 GB
Read Metrics
Write Metrics
Summary….
Metrics Test Setup #1(12G Heap/ 30G) Test Setup #2(8GB Heap/~30G) Test Setup #3 (8GB Heap/ 60GB data)
C* 1.2 C* 2.0 C* 1.2 C* 2.0 C* 1.2 C* 2.0
ROps 3.1K - 4.0K/ sec 2.6 - 3.5 K/ sec 3.5K - 4.0K/ sec 3.0 - 3.5 K/ sec 2.5 K - 3.5 K / sec 2.0 K - 3.0 K/ sec
WOps 710 /sec 730 /sec 720 /sec 710 /sec 700 /sec 620 /sec
Read 95th 2.25k micro 2.89k micro 1.7k micro 2.1k micro 2.4k micro 3.5k micro
Read 99Th 3.6k micro 4.7k micro 2.6k micro 3.7k micro
9.0k micro (spikes
20k)
9.5k micro (spikes
19K)
Write 95th 720 micro 770 micro 730 micro 910 micro 730 micro 820 micro
Write 99Th 890 micro 1.01 k micro 910 micro 1.2 k micro 940 micro 1.1 k micro
Data / Node 30 - 36 GB 30 - 36 GB 30 - 36 GB 30 - 36 GB 60 GB 60 GB
Wave - 2 Testing
1. speculative_retry (New feature in 2.0)
2. For low connections, use rpc_server_type = sync
3. index_interval = 256 --> default value has changed.
4. internode_compression = all
5. memtable_flush_writers: 4
6. newgen -> 800mb
7. Heap: 12 GB - 2 GB(new gen)
8. read_repair_chance=0 and dclocal_read_repair_chance = 0
Test Setup #5 - Results (Duration: 2 Days)
Test Setup #5 C* 1.2 C* 2.0
ROps 3.8 K / sec 3.8 K/ sec
WOps 198 /sec 198 /sec
Read 95th 7.01k micro 5.89k micro
Read 99Th 27.3k micro (spikes upto 80k) 15.2k micro (spikes upto 60 k)
Read Avg 2.15 2.04
Write 95th 755 micro 895 micro
Write 99Th 961 micro 1.1 k micro
Write Avg 396 444
Data / Node 60 GB 60 GB
Test Case #5: Read 95th and 99th
Test Case #5: Write 95th and 99th
Teams Engaged
● Performance Team
● Several Application Teams
Few Migration Hiccups/ Roadblocks
● InterNodeEncryption = ‘ALL’ => why do we need this?
○ https://issues.apache.org/jira/browse/CASSANDRA-8751
● Hints causing Heap disaster
○ https://issues.apache.org/jira/browse/CASSANDRA-8485.
is
Hiring
jobs.netflix.com/#/jobs/1953/
or
jobs.netflix.com

More Related Content

Viewers also liked

C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...
C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...
C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...DataStax
 
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016DataStax
 
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per SecondAmazon Web Services
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBSJim Plush
 
Netflix company presentation
Netflix company presentationNetflix company presentation
Netflix company presentationklibanow
 
Cloud Connect 2012, Big Data @ Netflix
Cloud Connect 2012, Big Data @ NetflixCloud Connect 2012, Big Data @ Netflix
Cloud Connect 2012, Big Data @ NetflixJerome Boulon
 
IoTWorld Presentation by Accenture at DLA Piper Dinner
IoTWorld Presentation by Accenture at DLA Piper DinnerIoTWorld Presentation by Accenture at DLA Piper Dinner
IoTWorld Presentation by Accenture at DLA Piper DinnerMark Radcliffe
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformMongoDB
 
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programming
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original ProgrammingThe Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programming
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programminghye-jin-lee
 
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016DataStax
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Rick Branson
 
An Introduction to Priam
An Introduction to PriamAn Introduction to Priam
An Introduction to PriamJason Brown
 
6/18/14 Billing & Payments Engineering Meetup I
6/18/14 Billing & Payments Engineering Meetup I6/18/14 Billing & Payments Engineering Meetup I
6/18/14 Billing & Payments Engineering Meetup IMathieu Chauvin
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax Academy
 
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...DataStax
 
Netflix-Using analytics to predict hits
Netflix-Using analytics to predict hitsNetflix-Using analytics to predict hits
Netflix-Using analytics to predict hitsGaurav Dutta
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...DataStax
 
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformLarge Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformDataStax Academy
 
Netflix - Enabling a Culture of Analytics
Netflix - Enabling a Culture of AnalyticsNetflix - Enabling a Culture of Analytics
Netflix - Enabling a Culture of AnalyticsBlake Irvine
 
Introduction to Text Mining
Introduction to Text MiningIntroduction to Text Mining
Introduction to Text MiningMinha Hwang
 

Viewers also liked (20)

C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...
C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...
C* Capacity Forecasting (Ajay Upadhyay, Jyoti Shandil, Arun Agrawal, Netflix)...
 
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016
Everyday I'm Scaling... Cassandra (Ben Bromhead, Instaclustr) | C* Summit 2016
 
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
(BDT323) Amazon EBS & Cassandra: 1 Million Writes Per Second
 
1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS1 Million Writes per second on 60 nodes with Cassandra and EBS
1 Million Writes per second on 60 nodes with Cassandra and EBS
 
Netflix company presentation
Netflix company presentationNetflix company presentation
Netflix company presentation
 
Cloud Connect 2012, Big Data @ Netflix
Cloud Connect 2012, Big Data @ NetflixCloud Connect 2012, Big Data @ Netflix
Cloud Connect 2012, Big Data @ Netflix
 
IoTWorld Presentation by Accenture at DLA Piper Dinner
IoTWorld Presentation by Accenture at DLA Piper DinnerIoTWorld Presentation by Accenture at DLA Piper Dinner
IoTWorld Presentation by Accenture at DLA Piper Dinner
 
An Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media PlatformAn Elastic Metadata Store for eBay’s Media Platform
An Elastic Metadata Store for eBay’s Media Platform
 
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programming
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original ProgrammingThe Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programming
The Big Data TV: Data Analytics, Algorithm, and Netflix’s Original Programming
 
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
Monitoring Cassandra at Scale (Jason Cacciatore, Netflix) | C* Summit 2016
 
Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)Cassandra at Instagram (August 2013)
Cassandra at Instagram (August 2013)
 
An Introduction to Priam
An Introduction to PriamAn Introduction to Priam
An Introduction to Priam
 
6/18/14 Billing & Payments Engineering Meetup I
6/18/14 Billing & Payments Engineering Meetup I6/18/14 Billing & Payments Engineering Meetup I
6/18/14 Billing & Payments Engineering Meetup I
 
DataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenterDataStax: Backup and Restore in Cassandra and OpsCenter
DataStax: Backup and Restore in Cassandra and OpsCenter
 
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
Netflix Recommendations Using Spark + Cassandra (Prasanna Padmanabhan & Roopa...
 
Netflix-Using analytics to predict hits
Netflix-Using analytics to predict hitsNetflix-Using analytics to predict hits
Netflix-Using analytics to predict hits
 
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
Cassandra on Mesos Across Multiple Datacenters at Uber (Abhishek Verma) | C* ...
 
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE PlatformLarge Scale Data Analytics with Spark and Cassandra on the DSE Platform
Large Scale Data Analytics with Spark and Cassandra on the DSE Platform
 
Netflix - Enabling a Culture of Analytics
Netflix - Enabling a Culture of AnalyticsNetflix - Enabling a Culture of Analytics
Netflix - Enabling a Culture of Analytics
 
Introduction to Text Mining
Introduction to Text MiningIntroduction to Text Mining
Introduction to Text Mining
 

More from DataStax Academy

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftDataStax Academy
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseDataStax Academy
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraDataStax Academy
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsDataStax Academy
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingDataStax Academy
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackDataStax Academy
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache CassandraDataStax Academy
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready CassandraDataStax Academy
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonDataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1DataStax Academy
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2DataStax Academy
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First ClusterDataStax Academy
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with DseDataStax Academy
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraDataStax Academy
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseDataStax Academy
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraDataStax Academy
 

More from DataStax Academy (20)

Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craftForrester CXNYC 2017 - Delivering great real-time cx is a true craft
Forrester CXNYC 2017 - Delivering great real-time cx is a true craft
 
Introduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph DatabaseIntroduction to DataStax Enterprise Graph Database
Introduction to DataStax Enterprise Graph Database
 
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache CassandraIntroduction to DataStax Enterprise Advanced Replication with Apache Cassandra
Introduction to DataStax Enterprise Advanced Replication with Apache Cassandra
 
Cassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart LabsCassandra on Docker @ Walmart Labs
Cassandra on Docker @ Walmart Labs
 
Cassandra 3.0 Data Modeling
Cassandra 3.0 Data ModelingCassandra 3.0 Data Modeling
Cassandra 3.0 Data Modeling
 
Cassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stackCassandra Adoption on Cisco UCS & Open stack
Cassandra Adoption on Cisco UCS & Open stack
 
Data Modeling for Apache Cassandra
Data Modeling for Apache CassandraData Modeling for Apache Cassandra
Data Modeling for Apache Cassandra
 
Coursera Cassandra Driver
Coursera Cassandra DriverCoursera Cassandra Driver
Coursera Cassandra Driver
 
Production Ready Cassandra
Production Ready CassandraProduction Ready Cassandra
Production Ready Cassandra
 
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & PythonCassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
Cassandra @ Netflix: Monitoring C* at Scale, Gossip and Tickler & Python
 
Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1Cassandra @ Sony: The good, the bad, and the ugly part 1
Cassandra @ Sony: The good, the bad, and the ugly part 1
 
Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2Cassandra @ Sony: The good, the bad, and the ugly part 2
Cassandra @ Sony: The good, the bad, and the ugly part 2
 
Standing Up Your First Cluster
Standing Up Your First ClusterStanding Up Your First Cluster
Standing Up Your First Cluster
 
Real Time Analytics with Dse
Real Time Analytics with DseReal Time Analytics with Dse
Real Time Analytics with Dse
 
Introduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache CassandraIntroduction to Data Modeling with Apache Cassandra
Introduction to Data Modeling with Apache Cassandra
 
Cassandra Core Concepts
Cassandra Core ConceptsCassandra Core Concepts
Cassandra Core Concepts
 
Enabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax EnterpriseEnabling Search in your Cassandra Application with DataStax Enterprise
Enabling Search in your Cassandra Application with DataStax Enterprise
 
Bad Habits Die Hard
Bad Habits Die Hard Bad Habits Die Hard
Bad Habits Die Hard
 
Advanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache CassandraAdvanced Data Modeling with Apache Cassandra
Advanced Data Modeling with Apache Cassandra
 
Advanced Cassandra
Advanced CassandraAdvanced Cassandra
Advanced Cassandra
 

Recently uploaded

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
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 WorkerThousandEyes
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
Neo4j - How KGs are shaping the future of Generative AI at AWS Summit London ...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
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
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Cassandra Upgrades at Scale at Netflix

  • 1. C* Upgrades at Scale Ajay Upadhyay & Vinay Chella Data Architects
  • 2. Who are We?? ● Cloud Database Engineering [CDE] ● Providing Cassandra, Dynomite, Elastic Search and other data stores as a service ● Ajay Upadhyay ○ Data Architect @ Netflix ● Vinay Chella ○ Data Architect @ Netflix ○ https://www.linkedin.com/in/vinaykumarchella
  • 3. ● About Netflix ● Cassandra @ Netflix ● What is our C* scale ?? ● What do we upgrade, Why? ● How does it impact applications and services ● What makes C* upgrades smoother?? ● Infrastructure for upgrade ● Online Upgrade process ● Pappy framework ● Migration Hiccups/ Roadblocks Agenda
  • 4. 4 ● Started as DVD rental ● Internet delivery/ streaming of TV shows and movies directly on TVs, computers, and mobile devices in the United States and internationally About Netflix
  • 5. Cassandra @ Netflix ● 90% of streaming data is stored in Cassandra ● Data ranges from customer details to Viewing history to streaming bookmarks ● High availability, Multi-region resiliency and Active-Active
  • 6. What is our scale (C* Footprint) 235
  • 7. What is our scale (C* Footprint) Continue... 7000+
  • 8. Duration of the upgrade???
  • 9. What do we upgrade?? ● Software ○ Cassandra ○ Priam ○ OS ○ Other sidecars ● Hardware ○ AWS instance types
  • 10. What do we upgrade, Why? Continue... Why new release (C* 2.0)? What’s wrong with (1.2)?
  • 11. What do we upgrade, Why? continues... ● Typically nothing wrong with current release (in this case 1.2…) ● Pretty stable and few clusters are still running current release without any issues ● Still supported by Datastax but new features and bug fixes are not being done any more ● End of life cycle
  • 12. What do we upgrade, Why? continues... ● Good to be on latest and stable release ● Lots of great features ● Bug fixes and enhancements / new features are being only added to the latest release
  • 13. Application and service level impact/change ● Before Migration ● During migration ● After migration
  • 14. Application and service level impact/change ● None, if app is using latest Netflix OSS components (Astyanax/ BaseServer)
  • 16. What makes C* upgrades smoother and transparent
  • 17. How do we certify a binary??
  • 19. Is any existing functionality broken?
  • 20. How do we certify a binary for the final upgrade Simulate PROD ● Use pappy framework to simulate prod traffic on test clusters ● Soak it, make sure traffic pattern is same in terms of R/W OPS, storage and AWS instance type
  • 21. How do we certify a binary for the final upgrade Typical usage patterns: ● Read Heavy ● Write Heavy ● STCS ● LCS ● Aggressive TTLs ● Variable Payloads
  • 22. How do we certify a binary for the final upgrade continues... During Upgrade: ● Start upgrading one of the clusters to new release, keeping same traffic ● Any issues, get new patch, redo whole migration ● Process is fully automated, takes few minutes to couple of hours to redo entire test
  • 23. Summary ● Functional validation ● Performance testing ● Load test with routine maintenance tasks ○ Repair and Compaction ○ Replacement and Restarts ● Key Metrics Used ○ 95th and 99th Latencies ○ Dropped Metrics on C* ○ Exceptions on C* ○ Heap Usage on C* ○ Threads Pending on C* How do we certify a binary for the final upgrade continues...
  • 25. ● Health Monitoring Jobs ● Regular Maintenance Jobs ○ Repairs ○ Compactions ● Upgrades ○ Sizing ○ Instance Types ○ OS ○ Sidecar ○ C* Infrastructure for upgrade...
  • 26. Online upgrade process (steps) Pre-Upgrade: 1. Check for the forgotten files 2. Check for currently running (maintenance) jobs 3. Disable all the maintenance jobs until the duration of upgrade process a. Compact b. Repair c. Terminate 4. Disable Monkeys 5. Download the DSE tarball 6. Make sure that the cluster is healthy before starting upgrade
  • 27. Online upgrade process (steps) Upgrade: ● Running binary upgrade of Priam and C* on a node ○ Continue to make sure that the cluster is still healthy ○ Disable node in Eureka ○ Disable thrift, gossip and run nodetool drain ○ Stop Cassandra and Priam ○ Install new C* package (tarball) ○ Make sure the cluster is still healthy ■ Disable/Enable gossip if new node does not see all others vice-versa ○ Verify “nodetool version” ● Make sure the cluster is still healthy before next step
  • 28. Online upgrade process (steps) Post-Upgrade: 1. Alter CF settings (for all Keyspace/CF): speculative_retry = 'NONE' and index_interval = 256 2. Run SSTABLE Upgrade on all nodes (STCS - parallel, LCS - Serial) 3. Enable Chaos Monkey 4. Make sure the cluster is still healthy before considering the upgrade done
  • 30. One node at a time - parallelly in all regions
  • 31. One zone at a time - parallely in all regions
  • 32. One zone at a time??
  • 33. Binary upgrades?? Why not replacements??
  • 34. Dual Writes - Forklift (Pappy Framework) ● For short lived data and big clusters ● Astyanax - Dual Writes ● C* Forklifter - Pappy Framework
  • 35. Click of a button (Just 1 button….)
  • 38. What is Pappy?? ● CDE’s new Test harness framework ● Helps CDE moving fast with load / performance tests ● Netflix homegrown: Governated, well integrated with netflix OSS infrastructure (Archaius, Servo, Eureka and Karyan) ● Side by side comparison of different performance runs
  • 39. High level features ● Collects metrics for ○ Various Instance types comparison ○ Varying data models in terms of payload, shard and comparators ○ Different driver(s) versions ● Pluggable architecture enables working with various datastores (Cassandra, Dyno, ES etc.,)
  • 41. Performance testing... ● More than 10 rounds of performance testing ● Yaml tuning ○ Read heavy - Write heavy ○ Write heavy ○ Read heavy
  • 42. Test Setup #1 Row Size: 1KB (size-100*cols-10) Data Size: 30GB (Keys: 20,000,000) Read: 4K (3.6 K) Writes: 1 K (700) Instance: i2.xl (4 CPU, 30 GB RAM) Nodes: 6 Region: Us-East Read CL CL_ONE Write CL CL_ONE Heap 12 GB / Newgen: 2GB
  • 43. Test Setup #1 - Results Test Setup #1 C* 1.2 C* 2.0 ROps 3.1 K - 4.0 K / sec 2.6 - 3.5 K/ sec WOps 710 /sec 730 /sec Read 95th 2.25k micro 2.89k micro Read 99Th 3.6k micro 4.7k micro Write 95th 720 micro 770 micro Write 99Th 890 micro 1.01 k micro Data / Node 30 - 36 GB 30 - 36 GB
  • 46. Summary…. Metrics Test Setup #1(12G Heap/ 30G) Test Setup #2(8GB Heap/~30G) Test Setup #3 (8GB Heap/ 60GB data) C* 1.2 C* 2.0 C* 1.2 C* 2.0 C* 1.2 C* 2.0 ROps 3.1K - 4.0K/ sec 2.6 - 3.5 K/ sec 3.5K - 4.0K/ sec 3.0 - 3.5 K/ sec 2.5 K - 3.5 K / sec 2.0 K - 3.0 K/ sec WOps 710 /sec 730 /sec 720 /sec 710 /sec 700 /sec 620 /sec Read 95th 2.25k micro 2.89k micro 1.7k micro 2.1k micro 2.4k micro 3.5k micro Read 99Th 3.6k micro 4.7k micro 2.6k micro 3.7k micro 9.0k micro (spikes 20k) 9.5k micro (spikes 19K) Write 95th 720 micro 770 micro 730 micro 910 micro 730 micro 820 micro Write 99Th 890 micro 1.01 k micro 910 micro 1.2 k micro 940 micro 1.1 k micro Data / Node 30 - 36 GB 30 - 36 GB 30 - 36 GB 30 - 36 GB 60 GB 60 GB
  • 47. Wave - 2 Testing 1. speculative_retry (New feature in 2.0) 2. For low connections, use rpc_server_type = sync 3. index_interval = 256 --> default value has changed. 4. internode_compression = all 5. memtable_flush_writers: 4 6. newgen -> 800mb 7. Heap: 12 GB - 2 GB(new gen) 8. read_repair_chance=0 and dclocal_read_repair_chance = 0
  • 48. Test Setup #5 - Results (Duration: 2 Days) Test Setup #5 C* 1.2 C* 2.0 ROps 3.8 K / sec 3.8 K/ sec WOps 198 /sec 198 /sec Read 95th 7.01k micro 5.89k micro Read 99Th 27.3k micro (spikes upto 80k) 15.2k micro (spikes upto 60 k) Read Avg 2.15 2.04 Write 95th 755 micro 895 micro Write 99Th 961 micro 1.1 k micro Write Avg 396 444 Data / Node 60 GB 60 GB
  • 49. Test Case #5: Read 95th and 99th
  • 50. Test Case #5: Write 95th and 99th
  • 51. Teams Engaged ● Performance Team ● Several Application Teams
  • 52. Few Migration Hiccups/ Roadblocks ● InterNodeEncryption = ‘ALL’ => why do we need this? ○ https://issues.apache.org/jira/browse/CASSANDRA-8751 ● Hints causing Heap disaster ○ https://issues.apache.org/jira/browse/CASSANDRA-8485.
  • 53.