SlideShare a Scribd company logo
Apache Cassandra
Survivre en production
PARIS CASSANDRA MEETUP - JANVIER 2018
Alexander Dejanovski
@alexanderdeja
Consultant
www.thelastpickle.com
Datastax MVP for Apache Cassandra
Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License
www.bigdatahebdo.com
Licensed under a Creative Commons Attribution-NonCommercial 3.0 New Zealand License
AboutThe Last Pickle

Apache Cassandra consulting
4 committers / 3 PMC / 1VP Apache Cassandra
6 pays :
Nouvelle Zélande, Australie, France, Espagne, USA
et Estonie
Hardware
www.thelastpickle.com
CPU
8 à 16 threads
www.thelastpickle.com
RAM
32 à 64 Go
www.thelastpickle.com
Disques
Sérieusement… SSD !
www.thelastpickle.com
Monitoring
Grafana / Prometheus / DataDog
www.thelastpickle.com
GC settings
G1 vs CMS ?
Taille de heap ?
www.thelastpickle.com
Versions de Cassandra
2.x.x vs 3.0.x vs 3.11.x
www.thelastpickle.com
Authentification
www.thelastpickle.com
Encryption
node-to-node
client-to-node
www.thelastpickle.com
Partitionement !!
Les « grosses » partitions tuent
silencieusement vos clusters
www.thelastpickle.com
nodetool cfstats/tablestats

Table: cluster
SSTable count: 1
SSTables in each level: [1, 0, 0, 0, 0, 0, 0, 0, 0]
Space used (live): 5136
Space used (total): 5136
…
Bloom filter false positives: 0
Bloom filter false ratio: 0,00000
Bloom filter space used: 16
Bloom filter off heap memory used: 8
Index summary off heap memory used: 17
Compression metadata off heap memory used: 16
Compacted partition minimum bytes: 104
Compacted partition maximum bytes: 124
Compacted partition mean bytes: 124
Average live cells per slice (last five minutes): NaN
Maximum live cells per slice (last five minutes): 0
Average tombstones per slice (last five minutes): NaN
Maximum tombstones per slice (last five minutes): 0
Dropped Mutations: 0
www.thelastpickle.com
nodetool cfhistograms/tablehistograms

reaper_db/cluster histograms
Percentile SSTables Write Latency Read Latency Partition Size Cell Count
(micros) (micros) (bytes)
50% 0,00 0,00 0,00 124 4
75% 0,00 0,00 0,00 124 4
95% 0,00 0,00 0,00 124 4
98% 0,00 0,00 0,00 124 4
99% 0,00 0,00 0,00 124 4
Min 0,00 0,00 0,00 104 4
Max 0,00 0,00 0,00 124 4
www.thelastpickle.com
Réduire la durée
de vie des partitions
www.thelastpickle.com
Batches vs Async queries
www.thelastpickle.com
Pas de « read-before-write »
pour matérialiser un état
RACE CONDITIONS !
www.thelastpickle.com
Pas de changements
incrémentaux sur une
collection avec TTL
www.thelastpickle.com
MaterializedViews
www.thelastpickle.com
Index secondaires et SASI
www.thelastpickle.com
Compaction
www.thelastpickle.com
Débit et parallélisme
8 à 16MB/s min par compacteur
www.thelastpickle.com
Choix de stratégie
STCS / LCS / TWCS
www.thelastpickle.com
Beaucoup d’overwrites
et SSD ?
LCS
www.thelastpickle.com
Données avec TTL ?
TWCS
www.thelastpickle.com
Sinon ?
STCS
www.thelastpickle.com
Pas de compactions
manuelles
(sauf sur petits volumes)
www.thelastpickle.com
Limites de la STCS
www.thelastpickle.com
Tombstone compactions
unchecked_tombstone_compaction: true
tombstone_threshold: 0.2

tombstone_compaction_interval: 86400
www.thelastpickle.com
SSTable 1 [——————]
SSTable 2 [———————]
Tombstones [-]
www.thelastpickle.com
Limites de la LCS
www.thelastpickle.com
Limites de la TWCS
www.thelastpickle.com
Trop de SSTables ?
www.thelastpickle.com
Réparation
www.thelastpickle.com
Réparation avant C* 2.2
www.thelastpickle.com
How does anti-entropy repair works ?
www.thelastpickle.com
Merkle tree is requested to all replicas
www.thelastpickle.com
Validation compaction
www.thelastpickle.com
Merkle tree comparison
www.thelastpickle.com
Streaming
www.thelastpickle.com
The problem with dense nodes
Overstreaming
Chaque feuille de l’arbre de Merkle
peut contenir plusieurs partitions.
Résolution max de 32 000 feuilles
www.thelastpickle.com
Réparation après C* 2.2
www.thelastpickle.com
Incrémentale
&
Anticompaction
www.thelastpickle.com
How does incremental repair work ?
www.thelastpickle.com
Anticompaction
www.thelastpickle.com
Anticompaction (repair on all ranges on local node)
www.thelastpickle.com
Incremental repair


Sépare les SSTables en 2 pools non
compactables
www.thelastpickle.com
Anticompaction
N’apprécie pas la concurrence
www.thelastpickle.com
subrange repair
www.thelastpickle.com
Repair best practices
Dans Cassandra 2.2/3.x :
full repair = anticompaction.
subrange = pas d’anticompaction
www.thelastpickle.com
Repair best practices
Attendez la 4.0.x pour
faire de la réparation incrémentale…?


CASSANDRA-9143

Fix committed for 4.0
www.thelastpickle.com
Repair best practices


Ajustez l’intensité
de la réparation
www.thelastpickle.com
C’est quoi le conseil
sur la réparation alors ?
www.thelastpickle.com
http://cassandra-reaper.io
Reaper c’est bon, mangez-en !
www.thelastpickle.com
Une dernière chose
Vos réparations sont soumises
au débit de compaction max
(il est partagé par tous vos threads de compaction)
www.thelastpickle.com
Tombstones
cell / row / range / partition
www.thelastpickle.com
gc_grace_seconds
www.thelastpickle.com
gc_grace_seconds
Jamais < hint window
(sauf si TTL < hint window)
www.thelastpickle.com
gc_grace_seconds
Réduire à 3h si TTL
et pas de DELETE
www.thelastpickle.com
gc_grace_seconds
Caler sur votre cycle
de repair si DELETE
www.thelastpickle.com
Bootstrap
avec vnodes, 1 à la fois
(par rack)
www.thelastpickle.com
Bootstrap
avec racks
-Dcassandra.consistent.rangemovement=false
www.thelastpickle.com
Bootstrap
le cleanup c’est LONG !
www.thelastpickle.com
Bootstrap
replace_address_first_boot
www.thelastpickle.com
Merci!@alexanderdeja

More Related Content

PDF
Cassandra 3.x et la future 4.0
PDF
Real world tales of repair - Apache BigData
PDF
Scaling Cassandra for Big Data
PDF
The Smug Mug Tale
PDF
OSBConf 2015 | Using aws virtual tape library as storage for bacula bareos by...
PPTX
4 use cases for C* to Scylla
PDF
Cassandra
PPTX
IMCSummit 2016 Keynote - Benzi Galili - More Memory for In-Memory Easy
Cassandra 3.x et la future 4.0
Real world tales of repair - Apache BigData
Scaling Cassandra for Big Data
The Smug Mug Tale
OSBConf 2015 | Using aws virtual tape library as storage for bacula bareos by...
4 use cases for C* to Scylla
Cassandra
IMCSummit 2016 Keynote - Benzi Galili - More Memory for In-Memory Easy

What's hot (18)

PDF
Ceph at salesforce ceph day external presentation
PDF
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
PPTX
C* Summit EU 2013: Cassandra on Flash: Performance & Efficiency Lessons Learned
PDF
DataStax: Extreme Cassandra Optimization: The Sequel
PDF
AppOS: PostgreSQL Extension for Scalable File I/O @ PGConf.Asia 2019
PDF
NoSQL 동향
PDF
CASSANDRA MEETUP - Choosing the right cloud instances for success
PDF
MEETUP - Unboxing Apache Cassandra 3.10
PPTX
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
PDF
Introduction to Vacuum Freezing and XID
PDF
Bare metal Hadoop provisioning
PPT
Net App At Egis English
ODP
Logical replication with pglogical
PPTX
Super scaling singleton inserts
PDF
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
PDF
DRBD + OpenStack (Openstack Live Prague 2016)
PDF
C* Summit EU 2013: Practice Makes Perfect: Extreme Cassandra Optimization
PPTX
ProfessionalVMware BrownBag VCP5 Section3: Storage
Ceph at salesforce ceph day external presentation
Autovacuum, explained for engineers, new improved version PGConf.eu 2015 Vienna
C* Summit EU 2013: Cassandra on Flash: Performance & Efficiency Lessons Learned
DataStax: Extreme Cassandra Optimization: The Sequel
AppOS: PostgreSQL Extension for Scalable File I/O @ PGConf.Asia 2019
NoSQL 동향
CASSANDRA MEETUP - Choosing the right cloud instances for success
MEETUP - Unboxing Apache Cassandra 3.10
100500 способов кэширования в Oracle Database или как достичь максимальной ск...
Introduction to Vacuum Freezing and XID
Bare metal Hadoop provisioning
Net App At Egis English
Logical replication with pglogical
Super scaling singleton inserts
Ceph Day Beijing - Our journey to high performance large scale Ceph cluster a...
DRBD + OpenStack (Openstack Live Prague 2016)
C* Summit EU 2013: Practice Makes Perfect: Extreme Cassandra Optimization
ProfessionalVMware BrownBag VCP5 Section3: Storage
Ad

Recently uploaded (20)

PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Sustainable Sites - Green Building Construction
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PPT
Project quality management in manufacturing
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
web development for engineering and engineering
DOCX
573137875-Attendance-Management-System-original
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
DOCX
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Well-logging-methods_new................
PPT
Mechanical Engineering MATERIALS Selection
PPTX
Geodesy 1.pptx...............................................
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
UNIT 4 Total Quality Management .pptx
Sustainable Sites - Green Building Construction
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Project quality management in manufacturing
Structs to JSON How Go Powers REST APIs.pdf
Model Code of Practice - Construction Work - 21102022 .pdf
web development for engineering and engineering
573137875-Attendance-Management-System-original
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
ASol_English-Language-Literature-Set-1-27-02-2023-converted.docx
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
CYBER-CRIMES AND SECURITY A guide to understanding
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Well-logging-methods_new................
Mechanical Engineering MATERIALS Selection
Geodesy 1.pptx...............................................
Strings in CPP - Strings in C++ are sequences of characters used to store and...
Ad

Apache cassandra - survivre en production