SlideShare a Scribd company logo
Anubhav Kale
Running 400+ node Cassandra clusters in Azure
Running 400+ node
Cassandra clusters in Azure
Anubhav Kale
Senior Software Engineer – Microsoft Office 365
anubhav.kale@microsoft.com
1 The big picture
2 Our stack
3 Challenges
4 Solutions
5 Path forward
3© DataStax, All Rights Reserved.
Office 365 – Productivity services at scale !
1.6 billion – Sessions / month
59% - Commercial seat growth in FY16 Q2
20.6 million - Consumer Subscribers
>30 Million – iOS and Android devices run Outlook
Why ?
Are users happy with O365?
Are users fully utilizing the services they are paying us for?
How do we proactively find issues ?
Do we understand our users experience over their lifetime?
Linear Scale Fast Ingestion
Advanced
Analytics
How, where, what ?
Cassandra 2.1.13 running on Azure Linux VMs
Apache Kafka as the intermediate queue
Multiple Clusters to serve different teams / scale profiles
Common management stack for all clusters
Home grown internal and external monitoring, recovery
Tooling for On Call Activities, Backups et. al.
Datastax Ops Center does the heavy lifting
Architecture
Spark
Streaming
Spark Batch
Processing
Kafka
Cassandra
Store
O365 servers
Apps/Clients
Commerce
systems
Support
systems
Serving
Admin Portal
Support Tools
Ad Hoc Querying
Zeppelin
Splunk
The Cassandra side
10 Clusters - DSE 4.8.5
30 - 400+ nodes (300+ TB)
RF: 5
Virtual nodes
G1 GC
Gossiping-Snitch
Azure Networking
Public IP Addresses
Allow geo-redundant replication over Internet
Not secure
Virtual Networks
No bandwidth limit within a VNET, Allow replication via
1. High-Performance Gateway – Max 200Mbs.
2. Express Route – Max 10Gbs
3. VNET Peering (Public Preview) – No Limit
We use VNETs due to security requirements and dedicated bandwidth guarantees
Azure Deployment
ARM Templates with post-deployment scripts
Challenges
SSDs can vanish
SSDs give best latency and IOPs, but they are not persistent.
Why is this a problem?
• SSDs are ephemeral. When Azure moves VMs, VMs will lose SSDs !
• "A node with address %s already exists, cancelling join. " Use
cassandra.replace_address if you want to replace this node."
How to fix it?
. Restart using ‘–Dcassandra.replace_address=<ip address of node>’ in JVM opts
. Don’t forget to remove once the node joins the ring
. We built automation to detect and fix this, running continuously on all nodes
Are you really Rack-aware ?
We use Azure Fault Domains for rack-awareness.
Why is this a problem?
• When Azure moves nodes they can change FD.
• This invalidates the rack configured in cassandra-rackdc.properties
How to fix it?
. Cassandra won’t let you change DC / Racks of existing node. Must remove and
add the node.
. Automation to detect, and change rackdc.properties as needed
Streaming is slow
“nodetool rebuild” or equivalent is often necessary while replacing / adding new nodes.
Why is this a problem?
• If the node crashes while streaming, it starts from the beginning
• The source node does not transfer SS Table files in parallel
How to fix it?
. Set “nodetool streamthroughput” and “nodetool compactionthroughput” to 0
. sudo sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3
net.ipv4.tcp_keepalive_intvl=10
. Wait for JIRAs 4663 , 9766 to get fixed in your version of DSE !
We use 30GB heaps, so heap dump files tend to be large on our nodes.
Why is this a problem?
• A standard Azure OS disk is 30 GB.
• The default heap dump dir is /var/lib/cassandra.
• We often ran out of OS disk space when Cassandra crashed
How to fix it?
If you are running Datastax Enterprise:
Edit /etc/init.d/dse to add this line at the top: DUMPFILE_DIR=/mnt/dumps
Or, just don’t let Cassandra crash, whichever is easiest.
Heap dumps are big !!
Memory !
Running Spark and Cassandra on same node poses unique challenges
Why is this a problem?
• Bad models / spark code can easily fill up 30 GB heap
• Linux Kernel will kill DSE when VM running low on memory
• system.log won’t show this. sudo dmesg –T is the way to go !
How to fix it?
. Set -1000 as OOM Score in /proc/<pid>/omm_score_adj file
. Need automation since the pid will change on DSE process restarts
SS Table Compactions
If not tuned correctly, this will melt down clusters !
Why is this a problem?
• IO heavy activity
• Incorrect compaction strategy parameters is a time bomb !
• Makes tmp files requiring double the space until it finishes.
How to fix it?
. Use DTCS only if you can explain what Target.GetBuckets does !
. Use the more stable and easy to reason about thing : STCS
. Pay close attention to PendingTasks, PendingCompactions and “nodetool
compactionstats”
Schema Updates
If nodes are down while schema changes are made, badness happens !!
Why is this a problem?
• Schema version changes don’t get updated in saved_caches if a node is down.
This leads to “couldn’t find cfid=foo exceptions” in logs
• Very easy to repro in debugger
• Column add / removes are okay, renaming tables not so much !
How to fix it?
. Known problem in community, 3.0 should have a new storage engine
. Don’t rename tables. Create new tables, and migrate data. Yes, it sucks !!
SS Table Corruption
SS Tables can get corrupt! Plan for fault tolerance
Why is this a problem?
• Azure node restarts can cause this.
• Shows up as apache.cassandra.io.sstable.CorruptSSTableException:
• Node won’t start if disk_failure_policy is set to 0
How to fix it?
. “nodetool scrub” doesn’t usually fix such SS Tables.
. sudo find /mnt/cassandra/data -type f -path ./system -prune -o -path
./system_auth -prune -o -cmin -<Number of Minutes> -print | sudo xargs rm.
. Automation to automatically detect, delete bad tables and restart DSE.
Mutation Drops
Even with reasonable tuning, our nodes were showing mutation drops.
LocalMutationRunnable thread wasn’t getting scheduled to run within the configured read and
write timeouts.
Contributed below as part of diving deep in code.
JIRA Description
10866 Expose dropped mutations metrics per table
10605 MUTATION and COUNTER MUTATION using same thread pool
10580 Expose metrics for dropped messages latency
Backup / Restore
With RF = 5 and TBs of data, we need efficient data movement
Explored using a Data Center with RF =1 as “Backup DC”. Failed quickly because “restore” was slow !
Built rsync based solution to snapshot and backup periodically to 1 TB HDDs attached to every node.
Also lets us restore in staged fashion while taking live traffic
https://github.com/anubhavkale/CassandraTools
Takeaways
Don’t underestimate learning curve
Teach, coach, grow, help, assist your fellow team members !
Quiz : https://blogs.msdn.microsoft.com/anubhavk/2016/08/22/the-cassandra-challenge/
Debug multi-node Cassandra locally
You will be surprised often at how things work
How: https://blogs.msdn.microsoft.com/anubhavk/2016/08/25/debugging-multi-node-cassandra-cluster-on-
windows/
JIRA and Mailing Lists
Cassandra Devs are fantastic at explaining things deeply
You will find great workarounds there : e.g. CASSANDRA-10371 !
Looking forward
Azure Premium Storage
Network attacked SSD storage with local SSD cache
DS 14 VMs = 550 GB local cache !
Great IOPS and Latency if you RAID disks: Read here and here
We added DS VMs to our existing clusters and did not see any performance degradation. Working
through more formal tests.
Questions ?
Leverage Ops Center Metrics
Read and Write Latencies
SS Table Counts
Tombstone Counts
OS : CPU, Memory, Disk
Compactions
Blocked Tasks
Aggressively invest in automation
Use Chef or equivalent
Local Monitoring and recovery
Learn concepts deeply
Datastax Enterprise support !
More …
Enable encryption at rest
VNET Peering
Helps with connecting legacy services deployed on old Azure classic stack with new ARM stack
Use Azure HDInsight as Spark compute cluster
DSE Spark version is usually behind the industry latest
Running Spark + Cassandra on same node makes debugging performance issues tricky
Cassandra 3.x
Mostly for bug fixes, and general improvements to repairs
Cleanup !!
By design, Cassandra doesn’t delete data from disk if another node starts owning it.
Why is this a problem?
• When adding nodes to a ring, disk space on old nodes won’t be reclaimed
automatically !
• Disk pressure will bring nodes down
How to fix it?
. “nodetool cleanup”
. Safe to run in parallel on all nodes.
. Be sure to increase concurrent_compactors if needed.

More Related Content

What's hot (19)

PPTX
Everyday I’m scaling... Cassandra
Instaclustr
 
PPTX
Tales From the Field: The Wrong Way of Using Cassandra (Carlos Rolo, Pythian)...
DataStax
 
PPTX
Load testing Cassandra applications
Ben Slater
 
PDF
Cassandra CLuster Management by Japan Cassandra Community
Hiromitsu Komatsu
 
PDF
Develop Scalable Applications with DataStax Drivers (Alex Popescu, Bulat Shak...
DataStax
 
PDF
Instaclustr webinar 2017 feb 08 japan
Hiromitsu Komatsu
 
PDF
Pythian: My First 100 days with a Cassandra Cluster
DataStax Academy
 
ODP
Intro to cassandra
Aaron Ploetz
 
PPTX
Cassandra internals
narsiman
 
PPTX
M6d cassandrapresentation
Edward Capriolo
 
PDF
Clock Skew and Other Annoying Realities in Distributed Systems (Donny Nadolny...
DataStax
 
PDF
Micro-batching: High-performance writes
Instaclustr
 
PDF
Cassandra NoSQL Tutorial
Michelle Darling
 
PPTX
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
DataStax
 
PDF
Cassandra Summit 2014: Apache Cassandra Best Practices at Ebay
DataStax Academy
 
PPTX
Running Cassandra on Amazon EC2
Dave Gardner
 
PDF
Apache Cassandra in the Real World
Jeremy Hanna
 
PPTX
Apache Cassandra at the Geek2Geek Berlin
Christian Johannsen
 
PDF
Cassandra TK 2014 - Large Nodes
aaronmorton
 
Everyday I’m scaling... Cassandra
Instaclustr
 
Tales From the Field: The Wrong Way of Using Cassandra (Carlos Rolo, Pythian)...
DataStax
 
Load testing Cassandra applications
Ben Slater
 
Cassandra CLuster Management by Japan Cassandra Community
Hiromitsu Komatsu
 
Develop Scalable Applications with DataStax Drivers (Alex Popescu, Bulat Shak...
DataStax
 
Instaclustr webinar 2017 feb 08 japan
Hiromitsu Komatsu
 
Pythian: My First 100 days with a Cassandra Cluster
DataStax Academy
 
Intro to cassandra
Aaron Ploetz
 
Cassandra internals
narsiman
 
M6d cassandrapresentation
Edward Capriolo
 
Clock Skew and Other Annoying Realities in Distributed Systems (Donny Nadolny...
DataStax
 
Micro-batching: High-performance writes
Instaclustr
 
Cassandra NoSQL Tutorial
Michelle Darling
 
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
DataStax
 
Cassandra Summit 2014: Apache Cassandra Best Practices at Ebay
DataStax Academy
 
Running Cassandra on Amazon EC2
Dave Gardner
 
Apache Cassandra in the Real World
Jeremy Hanna
 
Apache Cassandra at the Geek2Geek Berlin
Christian Johannsen
 
Cassandra TK 2014 - Large Nodes
aaronmorton
 

Viewers also liked (18)

PPTX
Cassandra vs. MongoDB
ScaleGrid.io
 
PDF
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
PDF
cassandra
Akash R
 
PPT
VP R&D Open Seminar: Caching
Moshe Kaplan
 
PDF
LesFurets.com: From 0 to Cassandra on AWS in 30 days - Tsunami Alerting Syste...
DataStax Academy
 
PDF
LJC: Fault tolerance with Apache Cassandra
Christopher Batey
 
PDF
Cassandra - A Decentralized Structured Storage System
Varad Meru
 
PPT
Web systems architecture, Performance and More
Moshe Kaplan
 
PDF
Apache cassandra and spark. you got the the lighter, let's start the fire
Patrick McFadin
 
PPTX
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
DataStax
 
PDF
Continuous Integration for Spark Apps by Sean McIntyre
Spark Summit
 
PPTX
Powering the Internet of Things with Apache Hadoop
Cloudera, Inc.
 
PDF
Livy: A REST Web Service For Apache Spark
Jen Aman
 
PDF
Cassandra By Example: Data Modelling with CQL3
Eric Evans
 
PPTX
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
Edureka!
 
PDF
Cassandra and Docker Lessons Learned
DataStax Academy
 
PPTX
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Athiq Ahamed
 
PDF
Apache cassandra & apache spark for time series data
Patrick McFadin
 
Cassandra vs. MongoDB
ScaleGrid.io
 
Azure + DataStax Enterprise Powers Office 365 Per User Store
DataStax Academy
 
cassandra
Akash R
 
VP R&D Open Seminar: Caching
Moshe Kaplan
 
LesFurets.com: From 0 to Cassandra on AWS in 30 days - Tsunami Alerting Syste...
DataStax Academy
 
LJC: Fault tolerance with Apache Cassandra
Christopher Batey
 
Cassandra - A Decentralized Structured Storage System
Varad Meru
 
Web systems architecture, Performance and More
Moshe Kaplan
 
Apache cassandra and spark. you got the the lighter, let's start the fire
Patrick McFadin
 
Myths of Big Partitions (Robert Stupp, DataStax) | Cassandra Summit 2016
DataStax
 
Continuous Integration for Spark Apps by Sean McIntyre
Spark Summit
 
Powering the Internet of Things with Apache Hadoop
Cloudera, Inc.
 
Livy: A REST Web Service For Apache Spark
Jen Aman
 
Cassandra By Example: Data Modelling with CQL3
Eric Evans
 
HBase Vs Cassandra Vs MongoDB - Choosing the right NoSQL database
Edureka!
 
Cassandra and Docker Lessons Learned
DataStax Academy
 
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Athiq Ahamed
 
Apache cassandra & apache spark for time series data
Patrick McFadin
 
Ad

Similar to Running 400-node Cassandra + Spark Clusters in Azure (Anubhav Kale, Microsoft) | C* Summit 2016 (20)

PDF
Cassandra at Pollfish
Stavros Kontopoulos
 
PDF
Cassandra at Pollfish
Pollfish
 
PDF
RDS for MySQL, No BS Operations and Patterns
Laine Campbell
 
PDF
10 Devops-Friendly Database Must-Haves - Dor Laor, ScyllaDB - DevOpsDays Tel ...
DevOpsDays Tel Aviv
 
PDF
Migrating and living on rds aurora
Balazs Pocze
 
PPTX
Using Cassandra with your Web Application
supertom
 
PPTX
Inside Microsoft Azure
Ernest Mueller
 
PPTX
Speed up R with parallel programming in the Cloud
Revolution Analytics
 
PPTX
Scaling opensimulator inventory using nosql
David Daeschler
 
PDF
Speed up sql
Kaing Menglieng
 
PPS
Web20expo Scalable Web Arch
royans
 
PPS
Web20expo Scalable Web Arch
mclee
 
PPS
Web20expo Scalable Web Arch
guest18a0f1
 
PPT
Performance and Scalability
Mediacurrent
 
PDF
Cassandra Bootstrap from Backups
Instaclustr
 
PDF
Cassandra Bootstap from Backups
Instaclustr
 
PPS
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Cal Henderson
 
PDF
Breakthrough OLAP performance with Cassandra and Spark
Evan Chan
 
PDF
Cassandra tw presentation
OmarFaroque16
 
PDF
Moving from a Relational Database to Cassandra: Why, Where, When, and How
Anant Corporation
 
Cassandra at Pollfish
Stavros Kontopoulos
 
Cassandra at Pollfish
Pollfish
 
RDS for MySQL, No BS Operations and Patterns
Laine Campbell
 
10 Devops-Friendly Database Must-Haves - Dor Laor, ScyllaDB - DevOpsDays Tel ...
DevOpsDays Tel Aviv
 
Migrating and living on rds aurora
Balazs Pocze
 
Using Cassandra with your Web Application
supertom
 
Inside Microsoft Azure
Ernest Mueller
 
Speed up R with parallel programming in the Cloud
Revolution Analytics
 
Scaling opensimulator inventory using nosql
David Daeschler
 
Speed up sql
Kaing Menglieng
 
Web20expo Scalable Web Arch
royans
 
Web20expo Scalable Web Arch
mclee
 
Web20expo Scalable Web Arch
guest18a0f1
 
Performance and Scalability
Mediacurrent
 
Cassandra Bootstrap from Backups
Instaclustr
 
Cassandra Bootstap from Backups
Instaclustr
 
Scalable Web Architectures: Common Patterns and Approaches - Web 2.0 Expo NYC
Cal Henderson
 
Breakthrough OLAP performance with Cassandra and Spark
Evan Chan
 
Cassandra tw presentation
OmarFaroque16
 
Moving from a Relational Database to Cassandra: Why, Where, When, and How
Anant Corporation
 
Ad

More from DataStax (20)

PPTX
Is Your Enterprise Ready to Shine This Holiday Season?
DataStax
 
PPTX
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
DataStax
 
PPTX
Running DataStax Enterprise in VMware Cloud and Hybrid Environments
DataStax
 
PPTX
Best Practices for Getting to Production with DataStax Enterprise Graph
DataStax
 
PPTX
Webinar | Data Management for Hybrid and Multi-Cloud: A Four-Step Journey
DataStax
 
PPTX
Webinar | How to Understand Apache Cassandra™ Performance Through Read/Writ...
DataStax
 
PDF
Webinar | Better Together: Apache Cassandra and Apache Kafka
DataStax
 
PDF
Top 10 Best Practices for Apache Cassandra and DataStax Enterprise
DataStax
 
PDF
Introduction to Apache Cassandra™ + What’s New in 4.0
DataStax
 
PPTX
Webinar: How Active Everywhere Database Architecture Accelerates Hybrid Cloud...
DataStax
 
PPTX
Webinar | Aligning GDPR Requirements with Today's Hybrid Cloud Realities
DataStax
 
PDF
Designing a Distributed Cloud Database for Dummies
DataStax
 
PDF
How to Power Innovation with Geo-Distributed Data Management in Hybrid Cloud
DataStax
 
PDF
How to Evaluate Cloud Databases for eCommerce
DataStax
 
PPTX
Webinar: DataStax Enterprise 6: 10 Ways to Multiply the Power of Apache Cassa...
DataStax
 
PPTX
Webinar: DataStax and Microsoft Azure: Empowering the Right-Now Enterprise wi...
DataStax
 
PPTX
Webinar - Real-Time Customer Experience for the Right-Now Enterprise featurin...
DataStax
 
PPTX
Datastax - The Architect's guide to customer experience (CX)
DataStax
 
PPTX
An Operational Data Layer is Critical for Transformative Banking Applications
DataStax
 
PPTX
Becoming a Customer-Centric Enterprise Via Real-Time Data and Design Thinking
DataStax
 
Is Your Enterprise Ready to Shine This Holiday Season?
DataStax
 
Designing Fault-Tolerant Applications with DataStax Enterprise and Apache Cas...
DataStax
 
Running DataStax Enterprise in VMware Cloud and Hybrid Environments
DataStax
 
Best Practices for Getting to Production with DataStax Enterprise Graph
DataStax
 
Webinar | Data Management for Hybrid and Multi-Cloud: A Four-Step Journey
DataStax
 
Webinar | How to Understand Apache Cassandra™ Performance Through Read/Writ...
DataStax
 
Webinar | Better Together: Apache Cassandra and Apache Kafka
DataStax
 
Top 10 Best Practices for Apache Cassandra and DataStax Enterprise
DataStax
 
Introduction to Apache Cassandra™ + What’s New in 4.0
DataStax
 
Webinar: How Active Everywhere Database Architecture Accelerates Hybrid Cloud...
DataStax
 
Webinar | Aligning GDPR Requirements with Today's Hybrid Cloud Realities
DataStax
 
Designing a Distributed Cloud Database for Dummies
DataStax
 
How to Power Innovation with Geo-Distributed Data Management in Hybrid Cloud
DataStax
 
How to Evaluate Cloud Databases for eCommerce
DataStax
 
Webinar: DataStax Enterprise 6: 10 Ways to Multiply the Power of Apache Cassa...
DataStax
 
Webinar: DataStax and Microsoft Azure: Empowering the Right-Now Enterprise wi...
DataStax
 
Webinar - Real-Time Customer Experience for the Right-Now Enterprise featurin...
DataStax
 
Datastax - The Architect's guide to customer experience (CX)
DataStax
 
An Operational Data Layer is Critical for Transformative Banking Applications
DataStax
 
Becoming a Customer-Centric Enterprise Via Real-Time Data and Design Thinking
DataStax
 

Recently uploaded (20)

PPTX
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PPTX
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
PDF
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
PDF
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
PDF
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
PDF
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
PDF
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
PDF
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PPTX
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PDF
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
PDF
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
PDF
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 
Change Common Properties in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Digger Solo: Semantic search and maps for your local files
seanpedersen96
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
AOMEI Partition Assistant Crack 10.8.2 + WinPE Free Downlaod New Version 2025
bashirkhan333g
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
Help for Correlations in IBM SPSS Statistics.pptx
Version 1 Analytics
 
SciPy 2025 - Packaging a Scientific Python Project
Henry Schreiner
 
MiniTool Partition Wizard 12.8 Crack License Key LATEST
hashhshs786
 
How to Hire AI Developers_ Step-by-Step Guide in 2025.pdf
DianApps Technologies
 
AI + DevOps = Smart Automation with devseccops.ai.pdf
Devseccops.ai
 
The 5 Reasons for IT Maintenance - Arna Softech
Arna Softech
 
MiniTool Partition Wizard Free Crack + Full Free Download 2025
bashirkhan333g
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Coefficient of Variance in IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
[Solution] Why Choose the VeryPDF DRM Protector Custom-Built Solution for You...
Lingwen1998
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation Journey Session 1/5: Context Grounding and Autopilot for E...
klpathrudu
 
Driver Easy Pro 6.1.1 Crack Licensce key 2025 FREE
utfefguu
 
NEW-Viral>Wondershare Filmora 14.5.18.12900 Crack Free
sherryg1122g
 

Running 400-node Cassandra + Spark Clusters in Azure (Anubhav Kale, Microsoft) | C* Summit 2016

  • 1. Anubhav Kale Running 400+ node Cassandra clusters in Azure
  • 2. Running 400+ node Cassandra clusters in Azure Anubhav Kale Senior Software Engineer – Microsoft Office 365 [email protected]
  • 3. 1 The big picture 2 Our stack 3 Challenges 4 Solutions 5 Path forward 3© DataStax, All Rights Reserved.
  • 4. Office 365 – Productivity services at scale ! 1.6 billion – Sessions / month 59% - Commercial seat growth in FY16 Q2 20.6 million - Consumer Subscribers >30 Million – iOS and Android devices run Outlook
  • 5. Why ? Are users happy with O365? Are users fully utilizing the services they are paying us for? How do we proactively find issues ? Do we understand our users experience over their lifetime? Linear Scale Fast Ingestion Advanced Analytics
  • 6. How, where, what ? Cassandra 2.1.13 running on Azure Linux VMs Apache Kafka as the intermediate queue Multiple Clusters to serve different teams / scale profiles Common management stack for all clusters Home grown internal and external monitoring, recovery Tooling for On Call Activities, Backups et. al. Datastax Ops Center does the heavy lifting
  • 8. The Cassandra side 10 Clusters - DSE 4.8.5 30 - 400+ nodes (300+ TB) RF: 5 Virtual nodes G1 GC Gossiping-Snitch
  • 9. Azure Networking Public IP Addresses Allow geo-redundant replication over Internet Not secure Virtual Networks No bandwidth limit within a VNET, Allow replication via 1. High-Performance Gateway – Max 200Mbs. 2. Express Route – Max 10Gbs 3. VNET Peering (Public Preview) – No Limit We use VNETs due to security requirements and dedicated bandwidth guarantees
  • 10. Azure Deployment ARM Templates with post-deployment scripts
  • 12. SSDs can vanish SSDs give best latency and IOPs, but they are not persistent. Why is this a problem? • SSDs are ephemeral. When Azure moves VMs, VMs will lose SSDs ! • "A node with address %s already exists, cancelling join. " Use cassandra.replace_address if you want to replace this node." How to fix it? . Restart using ‘–Dcassandra.replace_address=<ip address of node>’ in JVM opts . Don’t forget to remove once the node joins the ring . We built automation to detect and fix this, running continuously on all nodes
  • 13. Are you really Rack-aware ? We use Azure Fault Domains for rack-awareness. Why is this a problem? • When Azure moves nodes they can change FD. • This invalidates the rack configured in cassandra-rackdc.properties How to fix it? . Cassandra won’t let you change DC / Racks of existing node. Must remove and add the node. . Automation to detect, and change rackdc.properties as needed
  • 14. Streaming is slow “nodetool rebuild” or equivalent is often necessary while replacing / adding new nodes. Why is this a problem? • If the node crashes while streaming, it starts from the beginning • The source node does not transfer SS Table files in parallel How to fix it? . Set “nodetool streamthroughput” and “nodetool compactionthroughput” to 0 . sudo sysctl -w net.ipv4.tcp_keepalive_time=60 net.ipv4.tcp_keepalive_probes=3 net.ipv4.tcp_keepalive_intvl=10 . Wait for JIRAs 4663 , 9766 to get fixed in your version of DSE !
  • 15. We use 30GB heaps, so heap dump files tend to be large on our nodes. Why is this a problem? • A standard Azure OS disk is 30 GB. • The default heap dump dir is /var/lib/cassandra. • We often ran out of OS disk space when Cassandra crashed How to fix it? If you are running Datastax Enterprise: Edit /etc/init.d/dse to add this line at the top: DUMPFILE_DIR=/mnt/dumps Or, just don’t let Cassandra crash, whichever is easiest. Heap dumps are big !!
  • 16. Memory ! Running Spark and Cassandra on same node poses unique challenges Why is this a problem? • Bad models / spark code can easily fill up 30 GB heap • Linux Kernel will kill DSE when VM running low on memory • system.log won’t show this. sudo dmesg –T is the way to go ! How to fix it? . Set -1000 as OOM Score in /proc/<pid>/omm_score_adj file . Need automation since the pid will change on DSE process restarts
  • 17. SS Table Compactions If not tuned correctly, this will melt down clusters ! Why is this a problem? • IO heavy activity • Incorrect compaction strategy parameters is a time bomb ! • Makes tmp files requiring double the space until it finishes. How to fix it? . Use DTCS only if you can explain what Target.GetBuckets does ! . Use the more stable and easy to reason about thing : STCS . Pay close attention to PendingTasks, PendingCompactions and “nodetool compactionstats”
  • 18. Schema Updates If nodes are down while schema changes are made, badness happens !! Why is this a problem? • Schema version changes don’t get updated in saved_caches if a node is down. This leads to “couldn’t find cfid=foo exceptions” in logs • Very easy to repro in debugger • Column add / removes are okay, renaming tables not so much ! How to fix it? . Known problem in community, 3.0 should have a new storage engine . Don’t rename tables. Create new tables, and migrate data. Yes, it sucks !!
  • 19. SS Table Corruption SS Tables can get corrupt! Plan for fault tolerance Why is this a problem? • Azure node restarts can cause this. • Shows up as apache.cassandra.io.sstable.CorruptSSTableException: • Node won’t start if disk_failure_policy is set to 0 How to fix it? . “nodetool scrub” doesn’t usually fix such SS Tables. . sudo find /mnt/cassandra/data -type f -path ./system -prune -o -path ./system_auth -prune -o -cmin -<Number of Minutes> -print | sudo xargs rm. . Automation to automatically detect, delete bad tables and restart DSE.
  • 20. Mutation Drops Even with reasonable tuning, our nodes were showing mutation drops. LocalMutationRunnable thread wasn’t getting scheduled to run within the configured read and write timeouts. Contributed below as part of diving deep in code. JIRA Description 10866 Expose dropped mutations metrics per table 10605 MUTATION and COUNTER MUTATION using same thread pool 10580 Expose metrics for dropped messages latency
  • 21. Backup / Restore With RF = 5 and TBs of data, we need efficient data movement Explored using a Data Center with RF =1 as “Backup DC”. Failed quickly because “restore” was slow ! Built rsync based solution to snapshot and backup periodically to 1 TB HDDs attached to every node. Also lets us restore in staged fashion while taking live traffic https://github.com/anubhavkale/CassandraTools
  • 23. Don’t underestimate learning curve Teach, coach, grow, help, assist your fellow team members ! Quiz : https://blogs.msdn.microsoft.com/anubhavk/2016/08/22/the-cassandra-challenge/ Debug multi-node Cassandra locally You will be surprised often at how things work How: https://blogs.msdn.microsoft.com/anubhavk/2016/08/25/debugging-multi-node-cassandra-cluster-on- windows/ JIRA and Mailing Lists Cassandra Devs are fantastic at explaining things deeply You will find great workarounds there : e.g. CASSANDRA-10371 !
  • 25. Azure Premium Storage Network attacked SSD storage with local SSD cache DS 14 VMs = 550 GB local cache ! Great IOPS and Latency if you RAID disks: Read here and here We added DS VMs to our existing clusters and did not see any performance degradation. Working through more formal tests.
  • 27. Leverage Ops Center Metrics Read and Write Latencies SS Table Counts Tombstone Counts OS : CPU, Memory, Disk Compactions Blocked Tasks Aggressively invest in automation Use Chef or equivalent Local Monitoring and recovery Learn concepts deeply Datastax Enterprise support !
  • 28. More … Enable encryption at rest VNET Peering Helps with connecting legacy services deployed on old Azure classic stack with new ARM stack Use Azure HDInsight as Spark compute cluster DSE Spark version is usually behind the industry latest Running Spark + Cassandra on same node makes debugging performance issues tricky Cassandra 3.x Mostly for bug fixes, and general improvements to repairs
  • 29. Cleanup !! By design, Cassandra doesn’t delete data from disk if another node starts owning it. Why is this a problem? • When adding nodes to a ring, disk space on old nodes won’t be reclaimed automatically ! • Disk pressure will bring nodes down How to fix it? . “nodetool cleanup” . Safe to run in parallel on all nodes. . Be sure to increase concurrent_compactors if needed.

Editor's Notes

  • #7: Compliance requirements a major design decision