SlideShare a Scribd company logo
Apache Cassandra
Anti-Patterns

Matthew F. Dennis // @mdennis
C* on a SAN
●   fact: C* was designed, from the start, for
    commodity hardware
●   more than just not requiring a SAN, C*
    actually performs better without one
●   SPOF
●   unnecessary (large) cost
●   “(un)coordinated” IO from nodes
●   SANs were designed to solve problems C*
    doesn’t have
Commit Log + Data Directory
                (on the same volume)


●   conflicting IO patterns
    ●   commit log is 100% sequential append only
    ●   data directory is (usually) random on reads
●   commit log is essentially serialized
●   massive difference in write
    throughput under load
●   NB: does not apply to SSDs or EC2
Oversize JVM Heaps
●   4 – 8 GB is good
    (assuming sufficient ram on your boxen)
●   10 – 12 GB is not bad
    (and often “correct”)
●   16GB == max
●   > 16GB => badness
●   heap >= boxen RAM => badness
oversized JVM heaps
 (for the visually oriented)
not using -pr on scheduled repairs


●   -pr is kind of new
●   only applies to scheduled repairs
●   reduces work to 1/RF (e.g. 1/3)
low file handle limit
●   C* requires lots of file handles
    (sorry, deal with it)
●   Sockets and SSTables mostly
●   1024 (common default) is not sufficient
●   fails in horrible miserably unpredictable ways
    (though clear from the logs after the fact)
●   32K - 128K is common
●   unlimited is also common, but personally I
    prefer some sort of limit ...
Load Balacners
                   (in front of C*)


●   clients will load balance
    (C* has no master so this can work reliably)
●   SPOF
●   performance bottle neck
●   unneeded complexity
●   unneeded cost
restricting clients to a single node


●   why?
●   no really, I don’t understand how
    this was thought to be a good idea
●   thedailywtf.com territory
Unbalanced Ring
●   used to be the number one
    problem encountered
●   OPSC automates the resolution of
    this to two clicks (do it + confirm)
    even across multiple data centers
●   related: don’t let C* auto pick your
    tokens, always specify initial_token
Row Cache + Slice Queries

●   the row cache is a row cache, not a query cache or
    slice cache or magic cache or WTF-ever-you-thought-
    it-was cache
●   for the obvious impaired: that’s why we called it a
    row cache – because it caches rows
●   laughable performance difference in some extreme
    cases (e.g. 100X increase in throughput, 10X drop in
    latency, maxed cpu to under 10% average)
Row Cache + Large Rows


●   2GB row? yeah, lets cache that !!!

●   related: wtf are you doing trying to
    read a 2GB row all at once anyway?
OPP/BOP
●   if you think you need BOP, check
    again
●   no seriously, you’re doing it wrong
●   if you use BOP anyway:
    ●   IRC will mock you
    ●   your OPS team will plan your disappearance
    ●   I will setup a auto reply for your entire domain
        that responds solely with “stop using BOP”
Unbounded Batches
●   batches are sent as a single message
●   they must fit entirely in memory
    (both server side and client side)
●   best size is very much an empirical
    exercise depending on your HW, load,
    data model, moon phase, etc
    (start with 10 – 100 and tune)
●   NB: streaming transport will address
    this in future releases
Bad Rotational Math

●   rotational disks require seek time
●   5ms is a fast seek time for a rotational disk
●   you cannot get thousands of random seeks
    per second from rotational disks
●   caches/memory alleviate this, SSDs solve it
●   maths are teh hard? buy SSDs
●   everything fits in memory? I don’t care what
    disks you buy
32 Bit JVMs

●   C* deals (usually) with BigData
●   32 bits cannot address BigData
●   mmap, file offsets, heaps, caches
●   always wrong? no, I guess not ...
EBS volumes
●   nice in theory, but ...
●   not predictable
●   freezes common
●   outages common
●   stripe ephemeral drives instead
●   provisioned IOPS EBS?
    future hazy, ask again later
Non-Sun (err, Oracle) JVM

●   at least u22, but in general the
    latest release
    (unless you have specific reasons otherwise)
●   this is changing
●   some people (successfully) use
    OpenJDK anyway
Super Columns
●   10-15 percent overhead on reads and writes
●   entire super column is always held in memory
    at all stages
●   most C* devs hate working on them
●   C* and DataStax is committed to maintaining
    the API going forward, but they should be
    avoided for new projects
●   composite columns are an alternative
Not Running OPSC

●   extremely useful postmortem
●   trivial (usually) to setup
●   DataStax offers a free version
    (you have no excuse now)
Q?
Matthew F. Dennis // @mdennis
Thank You!
 Matthew F. Dennis // @mdennis
 http://slideshare.net/mattdennis

More Related Content

PDF
Cassandra Anti-Patterns
PDF
Cassandra On EC2
PDF
BigData as a Platform: Cassandra and Current Trends
PDF
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
PDF
C* Summit 2013: Practice Makes Perfect: Extreme Cassandra Optimization by Alb...
PDF
Sharding: Past, Present and Future with Krutika Dhananjay
PDF
Scaling Cassandra for Big Data
PPT
Mysql talk
Cassandra Anti-Patterns
Cassandra On EC2
BigData as a Platform: Cassandra and Current Trends
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
C* Summit 2013: Practice Makes Perfect: Extreme Cassandra Optimization by Alb...
Sharding: Past, Present and Future with Krutika Dhananjay
Scaling Cassandra for Big Data
Mysql talk

What's hot (20)

ODP
Logical replication with pglogical
ODP
Shootout at the AWS Corral
PDF
Cassandra NYC 2011 Data Modeling
ODP
PostgreSQL Replication in 10 Minutes - SCALE
PDF
Seastore: Next Generation Backing Store for Ceph
PDF
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
PDF
Elephant Roads: a tour of Postgres forks
PDF
92 grand prix_2013
PDF
P99CONF — What We Need to Unlearn About Persistent Storage
ODP
Shootout at the PAAS Corral
PDF
Ndb cluster 80_ycsb_mem
PPTX
Responding rapidly when you have 100+ GB data sets in Java
PPTX
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
PDF
OOPs, OOMs, oh my! Containerizing JVM apps
PDF
Avoiding Data Hotspots at Scale
PDF
Unikraft: Fast, Specialized Unikernels the Easy Way
PPTX
Low latency for high throughput
ODP
Fail over fail_back
PDF
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
PDF
7 Ways To Crash Postgres
Logical replication with pglogical
Shootout at the AWS Corral
Cassandra NYC 2011 Data Modeling
PostgreSQL Replication in 10 Minutes - SCALE
Seastore: Next Generation Backing Store for Ceph
PostgreSQL worst practices, version PGConf.US 2017 by Ilya Kosmodemiansky
Elephant Roads: a tour of Postgres forks
92 grand prix_2013
P99CONF — What We Need to Unlearn About Persistent Storage
Shootout at the PAAS Corral
Ndb cluster 80_ycsb_mem
Responding rapidly when you have 100+ GB data sets in Java
HighLoad Solutions On MySQL / Xiaobin Lin (Alibaba)
OOPs, OOMs, oh my! Containerizing JVM apps
Avoiding Data Hotspots at Scale
Unikraft: Fast, Specialized Unikernels the Easy Way
Low latency for high throughput
Fail over fail_back
Streaming Replication (Keynote @ PostgreSQL Conference 2009 Japan)
7 Ways To Crash Postgres
Ad

Viewers also liked (20)

PDF
Cassandra nice use cases and worst anti patterns
PPTX
Cassandra concepts, patterns and anti-patterns
PDF
DZone Cassandra Data Modeling Webinar
PDF
durability, durability, durability
PDF
Cassandra Data Modeling
PDF
Cassandra, Modeling and Availability at AMUG
PDF
The Future Of Big Data
PPTX
Learning Cassandra
PDF
Advanced data modeling with apache cassandra
PPTX
Cassandra Data Modeling - Practical Considerations @ Netflix
PPTX
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
PDF
Acunu Analytics: Simpler Real-Time Cassandra Apps
PDF
Virtual nodes: Operational Aspirin
PPTX
Tuberculosis abdominal
PDF
Webinar Cassandra Anti-Patterns
PDF
Fears, misconceptions, and accepted anti patterns of a first time cassandra a...
PDF
Денис Нелюбин, "Тамтэк"
PDF
Cassandra Day Chicago 2015: Top 5 Tips/Tricks with Apache Cassandra and DSE
PDF
Cap Theorem
PPTX
No sql system_survey
Cassandra nice use cases and worst anti patterns
Cassandra concepts, patterns and anti-patterns
DZone Cassandra Data Modeling Webinar
durability, durability, durability
Cassandra Data Modeling
Cassandra, Modeling and Availability at AMUG
The Future Of Big Data
Learning Cassandra
Advanced data modeling with apache cassandra
Cassandra Data Modeling - Practical Considerations @ Netflix
Lessons Learned From Running 1800 Clusters (Brooke Jensen, Instaclustr) | Cas...
Acunu Analytics: Simpler Real-Time Cassandra Apps
Virtual nodes: Operational Aspirin
Tuberculosis abdominal
Webinar Cassandra Anti-Patterns
Fears, misconceptions, and accepted anti patterns of a first time cassandra a...
Денис Нелюбин, "Тамтэк"
Cassandra Day Chicago 2015: Top 5 Tips/Tricks with Apache Cassandra and DSE
Cap Theorem
No sql system_survey
Ad

Similar to strangeloop 2012 apache cassandra anti patterns (20)

PPTX
Efficient Buffer Management
PDF
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farm
PDF
Java vs. C/C++
PDF
Mongodb meetup
PDF
Retaining Goodput with Query Rate Limiting
PDF
Five steps perform_2009 (1)
PDF
5 Steps to PostgreSQL Performance
PDF
Performance optimization techniques for Java code
PDF
Solr on Docker: the Good, the Bad, and the Ugly - Radu Gheorghe, Sematext Gro...
PDF
Solr on Docker - the Good, the Bad and the Ugly
PDF
UKOUG 2011: Practical MySQL Tuning
PPTX
Ceph Day Chicago - Ceph at work at Bloomberg
PDF
Caching in
PPTX
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
PPTX
SSDs, IMDGs and All the Rest - Jax London
PDF
Java under the hood
PPTX
Open Source Data Deduplication
PDF
Long Term Road Test of C*
PDF
Kafka on ZFS: Better Living Through Filesystems
PDF
Memory Management and Leaks in Postgres from pgext.day 2025
Efficient Buffer Management
Kernel Recipes 2016 - Speeding up development by setting up a kernel build farm
Java vs. C/C++
Mongodb meetup
Retaining Goodput with Query Rate Limiting
Five steps perform_2009 (1)
5 Steps to PostgreSQL Performance
Performance optimization techniques for Java code
Solr on Docker: the Good, the Bad, and the Ugly - Radu Gheorghe, Sematext Gro...
Solr on Docker - the Good, the Bad and the Ugly
UKOUG 2011: Practical MySQL Tuning
Ceph Day Chicago - Ceph at work at Bloomberg
Caching in
How to randomly access data in close-to-RAM speeds but a lower cost with SSD’...
SSDs, IMDGs and All the Rest - Jax London
Java under the hood
Open Source Data Deduplication
Long Term Road Test of C*
Kafka on ZFS: Better Living Through Filesystems
Memory Management and Leaks in Postgres from pgext.day 2025

Recently uploaded (20)

PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Approach and Philosophy of On baking technology
PDF
Empathic Computing: Creating Shared Understanding
PDF
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
PDF
NewMind AI Monthly Chronicles - July 2025
PPT
Teaching material agriculture food technology
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
GamePlan Trading System Review: Professional Trader's Honest Take
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
cuic standard and advanced reporting.pdf
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PDF
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
PDF
Modernizing your data center with Dell and AMD
PPTX
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectral efficient network and resource selection model in 5G networks
Dropbox Q2 2025 Financial Results & Investor Presentation
Approach and Philosophy of On baking technology
Empathic Computing: Creating Shared Understanding
GDG Cloud Iasi [PUBLIC] Florian Blaga - Unveiling the Evolution of Cybersecur...
NewMind AI Monthly Chronicles - July 2025
Teaching material agriculture food technology
Unlocking AI with Model Context Protocol (MCP)
GamePlan Trading System Review: Professional Trader's Honest Take
Understanding_Digital_Forensics_Presentation.pptx
Review of recent advances in non-invasive hemoglobin estimation
Reach Out and Touch Someone: Haptics and Empathic Computing
cuic standard and advanced reporting.pdf
Diabetes mellitus diagnosis method based random forest with bat algorithm
solutions_manual_-_materials___processing_in_manufacturing__demargo_.pdf
Modernizing your data center with Dell and AMD
breach-and-attack-simulation-cybersecurity-india-chennai-defenderrabbit-2025....
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

strangeloop 2012 apache cassandra anti patterns

  • 2. C* on a SAN ● fact: C* was designed, from the start, for commodity hardware ● more than just not requiring a SAN, C* actually performs better without one ● SPOF ● unnecessary (large) cost ● “(un)coordinated” IO from nodes ● SANs were designed to solve problems C* doesn’t have
  • 3. Commit Log + Data Directory (on the same volume) ● conflicting IO patterns ● commit log is 100% sequential append only ● data directory is (usually) random on reads ● commit log is essentially serialized ● massive difference in write throughput under load ● NB: does not apply to SSDs or EC2
  • 4. Oversize JVM Heaps ● 4 – 8 GB is good (assuming sufficient ram on your boxen) ● 10 – 12 GB is not bad (and often “correct”) ● 16GB == max ● > 16GB => badness ● heap >= boxen RAM => badness
  • 5. oversized JVM heaps (for the visually oriented)
  • 6. not using -pr on scheduled repairs ● -pr is kind of new ● only applies to scheduled repairs ● reduces work to 1/RF (e.g. 1/3)
  • 7. low file handle limit ● C* requires lots of file handles (sorry, deal with it) ● Sockets and SSTables mostly ● 1024 (common default) is not sufficient ● fails in horrible miserably unpredictable ways (though clear from the logs after the fact) ● 32K - 128K is common ● unlimited is also common, but personally I prefer some sort of limit ...
  • 8. Load Balacners (in front of C*) ● clients will load balance (C* has no master so this can work reliably) ● SPOF ● performance bottle neck ● unneeded complexity ● unneeded cost
  • 9. restricting clients to a single node ● why? ● no really, I don’t understand how this was thought to be a good idea ● thedailywtf.com territory
  • 10. Unbalanced Ring ● used to be the number one problem encountered ● OPSC automates the resolution of this to two clicks (do it + confirm) even across multiple data centers ● related: don’t let C* auto pick your tokens, always specify initial_token
  • 11. Row Cache + Slice Queries ● the row cache is a row cache, not a query cache or slice cache or magic cache or WTF-ever-you-thought- it-was cache ● for the obvious impaired: that’s why we called it a row cache – because it caches rows ● laughable performance difference in some extreme cases (e.g. 100X increase in throughput, 10X drop in latency, maxed cpu to under 10% average)
  • 12. Row Cache + Large Rows ● 2GB row? yeah, lets cache that !!! ● related: wtf are you doing trying to read a 2GB row all at once anyway?
  • 13. OPP/BOP ● if you think you need BOP, check again ● no seriously, you’re doing it wrong ● if you use BOP anyway: ● IRC will mock you ● your OPS team will plan your disappearance ● I will setup a auto reply for your entire domain that responds solely with “stop using BOP”
  • 14. Unbounded Batches ● batches are sent as a single message ● they must fit entirely in memory (both server side and client side) ● best size is very much an empirical exercise depending on your HW, load, data model, moon phase, etc (start with 10 – 100 and tune) ● NB: streaming transport will address this in future releases
  • 15. Bad Rotational Math ● rotational disks require seek time ● 5ms is a fast seek time for a rotational disk ● you cannot get thousands of random seeks per second from rotational disks ● caches/memory alleviate this, SSDs solve it ● maths are teh hard? buy SSDs ● everything fits in memory? I don’t care what disks you buy
  • 16. 32 Bit JVMs ● C* deals (usually) with BigData ● 32 bits cannot address BigData ● mmap, file offsets, heaps, caches ● always wrong? no, I guess not ...
  • 17. EBS volumes ● nice in theory, but ... ● not predictable ● freezes common ● outages common ● stripe ephemeral drives instead ● provisioned IOPS EBS? future hazy, ask again later
  • 18. Non-Sun (err, Oracle) JVM ● at least u22, but in general the latest release (unless you have specific reasons otherwise) ● this is changing ● some people (successfully) use OpenJDK anyway
  • 19. Super Columns ● 10-15 percent overhead on reads and writes ● entire super column is always held in memory at all stages ● most C* devs hate working on them ● C* and DataStax is committed to maintaining the API going forward, but they should be avoided for new projects ● composite columns are an alternative
  • 20. Not Running OPSC ● extremely useful postmortem ● trivial (usually) to setup ● DataStax offers a free version (you have no excuse now)
  • 21. Q? Matthew F. Dennis // @mdennis
  • 22. Thank You! Matthew F. Dennis // @mdennis http://slideshare.net/mattdennis