SlideShare uma empresa Scribd logo
1 de 24
Administrator Training with Apache Cassandra
                        Tuning


                   Datastax Inc.

              http://www.datastax.com/


                August 27, 2012




              Datastax Inc.   Administrator Training with Apache Cassandra   1/ 24
Outline




   1 Overview



   2 Cache



   3 Summary




                Datastax Inc.   Administrator Training with Apache Cassandra   2/ 24
Tuning Cassandra




      Effective tuning depends on your use case
      What operations are performed?
      What does your data look like?
      Wide Rows
      Skinny Rows




                        Datastax Inc.   Administrator Training with Apache Cassandra   3/ 24
Outline




   1 Overview



   2 Cache



   3 Summary




                Datastax Inc.   Administrator Training with Apache Cassandra   4/ 24
Tuning the Cache




      Cassandra’s Cache is VERY efficient
      Takes lessons from dedicated caches
      Solve cache coherence issues
      Remove tiers from the application
      Cache never needs to be completely cold




                        Datastax Inc.   Administrator Training with Apache Cassandra   5/ 24
Row Cache




     Return whenever possible
     A hit will never seek




                        Datastax Inc.   Administrator Training with Apache Cassandra   6/ 24
Key Cache




      Used if Row Cache misses
      Key → SSTable is not 1:1
      Each hit saves 1 seek
      Populated from a miss




                        Datastax Inc.   Administrator Training with Apache Cassandra   7/ 24
Key Cache(cont.)




      Map of (key, list<(sstable, location)>)
      Per ColumnFamily
      Large numbers of rows accessed frequently
      Adjust by changing keys_cached on the ColumnFamily




                        Datastax Inc.   Administrator Training with Apache Cassandra   8/ 24
Adjusting the Key Cache




   [


   cassandra-cli to adjust the key cache]


   [default@demo] UPDATE COLUMN FAMILY users WITH keys_cached=




                           Datastax Inc.   Administrator Training with Apache Cassandra   9/ 24
Monitor Key Cache




      nodetool cfstats
      RecentHitRate (jmx)




                     Datastax Inc.   Administrator Training with Apache Cassandra   10/ 24
Monitor Key Cache




      nodetool cfstats
      RecentHitRate (jmx)




                     Datastax Inc.   Administrator Training with Apache Cassandra   11/ 24
Configuring Row Cache




      Put the entire row in memory
          This can be harmful
          Disabled by default
      Disable it for ColumnFamilies with wide rows
      Now stored off-heap




                        Datastax Inc.   Administrator Training with Apache Cassandra   12/ 24
Candidate Column Families for Row Cache




      Accesses a small subset of rows
      All, or most columns are returned
      Used properly improvement is substantial




                        Datastax Inc.   Administrator Training with Apache Cassandra   13/ 24
Adjusting the Row Cache




   [


   cassandra-cli to adjust the key cache]


   [default@demo] UPDATE COLUMN FAMILY users WITH rows_cached=
   AND row_cache_provider=’SerializingCacheProvider’;




                           Datastax Inc.   Administrator Training with Apache Cassandra   14/ 24
Monitor Row Cache




      nodetool cfstats
      RecentHitRate (jmx)




                     Datastax Inc.   Administrator Training with Apache Cassandra   15/ 24
Data Modeling Considerations




      Logical separation of workloads
          Read heavy
          Write heavy
      Narrow Rows, Frequently Accessed
      Normal (Gaussian) distributions work well
      A few ’Hot’ rows




                         Datastax Inc.   Administrator Training with Apache Cassandra   16/ 24
Hardware and OS



      Large number of nodes under light load
          Ideal for in memory cache
      OS Page Cache
          Lower memtable size
          Lower heap size
      Balanced need
          heap
          memtables
          cache




                        Datastax Inc.   Administrator Training with Apache Cassandra   17/ 24
Estimating Cache Sizes




      nodetool cfstats
      Number of keys cached * average key size
      Number of rows cached * average row size




                       Datastax Inc.   Administrator Training with Apache Cassandra   18/ 24
Write Performance




      Write-back cache
      Thresholds are per-node
      PerCF thresholds have been deprecated
      commit_log_total_space_in_mb
      memtable_total_space_in_mb
      memtable_flush_queue_size (for secondary indexes)




                         Datastax Inc.   Administrator Training with Apache Cassandra   19/ 24
Java Heap Size




      Default 1/4 of the memory
          1GB - 8GB
      Little to negative benefit ¿ 8GB Heap
       (memtable_total_space_in_mb) + 1GB + (key_cache_size_e




                       Datastax Inc.   Administrator Training with Apache Cassandra   20/ 24
Garbage Collection




      Log Information when GC ¿ 200ms
          Add Nodes
          Decrease key-cache size
          index_interval
               default 128, 256, 512




                         Datastax Inc.   Administrator Training with Apache Cassandra   21/ 24
Compaction




     multithreaded_compaction
     compaction_throughput_mb_per_sec
     in_memory_compaction_limit_in_mb
     compaction_preheat_key_cache




                    Datastax Inc.   Administrator Training with Apache Cassandra   22/ 24
Outline




   1 Overview



   2 Cache



   3 Summary




                Datastax Inc.   Administrator Training with Apache Cassandra   23/ 24
Overview




      Lots of Options
      Dependent on your use case
      Cache
      IO




                        Datastax Inc.   Administrator Training with Apache Cassandra   24/ 24

Mais conteúdo relacionado

Mais procurados

ImpalaToGo design explained
ImpalaToGo design explainedImpalaToGo design explained
ImpalaToGo design explainedDavid Groozman
 
Apache Cassandra Training,Apache Cassandra Training in Bangalore india
Apache Cassandra Training,Apache Cassandra Training in Bangalore indiaApache Cassandra Training,Apache Cassandra Training in Bangalore india
Apache Cassandra Training,Apache Cassandra Training in Bangalore indiasharepointexpert
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBasephanleson
 
Load testing Cassandra applications
Load testing Cassandra applicationsLoad testing Cassandra applications
Load testing Cassandra applicationsBen Slater
 
Databases on aws part 1
Databases on aws   part 1Databases on aws   part 1
Databases on aws part 1Parag Patil
 
ImpalaToGo and Tachyon integration
ImpalaToGo and Tachyon integrationImpalaToGo and Tachyon integration
ImpalaToGo and Tachyon integrationDavid Groozman
 
HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...DataWorks Summit
 
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...Cloudera, Inc.
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...DataStax
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESLudovico Caldara
 
AWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon RedshiftAWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon RedshiftAmazon Web Services
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationLai Yoong Seng
 
hbaseconasia2017: Apache HBase at Netease
hbaseconasia2017: Apache HBase at Neteasehbaseconasia2017: Apache HBase at Netease
hbaseconasia2017: Apache HBase at NeteaseHBaseCon
 
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabCloudxLab
 
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...DataStax
 
HBaseCon 2015: HBase Operations in a Flurry
HBaseCon 2015: HBase Operations in a FlurryHBaseCon 2015: HBase Operations in a Flurry
HBaseCon 2015: HBase Operations in a FlurryHBaseCon
 
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...Yahoo Developer Network
 
HBase at Flurry
HBase at FlurryHBase at Flurry
HBase at Flurryddlatham
 

Mais procurados (20)

ImpalaToGo design explained
ImpalaToGo design explainedImpalaToGo design explained
ImpalaToGo design explained
 
Apache Cassandra Training,Apache Cassandra Training in Bangalore india
Apache Cassandra Training,Apache Cassandra Training in Bangalore indiaApache Cassandra Training,Apache Cassandra Training in Bangalore india
Apache Cassandra Training,Apache Cassandra Training in Bangalore india
 
Hbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBaseHbase in action - Chapter 09: Deploying HBase
Hbase in action - Chapter 09: Deploying HBase
 
Load testing Cassandra applications
Load testing Cassandra applicationsLoad testing Cassandra applications
Load testing Cassandra applications
 
Databases on aws part 1
Databases on aws   part 1Databases on aws   part 1
Databases on aws part 1
 
ImpalaToGo and Tachyon integration
ImpalaToGo and Tachyon integrationImpalaToGo and Tachyon integration
ImpalaToGo and Tachyon integration
 
HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...HBase Tales From the Trenches - Short stories about most common HBase operati...
HBase Tales From the Trenches - Short stories about most common HBase operati...
 
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...
HBaseCon 2013: Streaming Data into Apache HBase using Apache Flume: Experienc...
 
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
Lessons Learned on Java Tuning for Our Cassandra Clusters (Carlos Monroy, Kne...
 
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIESORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
ORACLE 12C DATA GUARD: FAR SYNC, REAL-TIME CASCADE STANDBY AND OTHER GOODIES
 
AWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon RedshiftAWS June Webinar Series - Getting Started: Amazon Redshift
AWS June Webinar Series - Getting Started: Amazon Redshift
 
NoSQL: Cassadra vs. HBase
NoSQL: Cassadra vs. HBaseNoSQL: Cassadra vs. HBase
NoSQL: Cassadra vs. HBase
 
Caching Strategies
Caching StrategiesCaching Strategies
Caching Strategies
 
Planning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft VirtualizationPlanning & Best Practice for Microsoft Virtualization
Planning & Best Practice for Microsoft Virtualization
 
hbaseconasia2017: Apache HBase at Netease
hbaseconasia2017: Apache HBase at Neteasehbaseconasia2017: Apache HBase at Netease
hbaseconasia2017: Apache HBase at Netease
 
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLabIntroduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
Introduction to NoSQL | Big Data Hadoop Spark Tutorial | CloudxLab
 
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...
Building a Pluggable Analytics Stack with Cassandra (Jim Peregord, Element Co...
 
HBaseCon 2015: HBase Operations in a Flurry
HBaseCon 2015: HBase Operations in a FlurryHBaseCon 2015: HBase Operations in a Flurry
HBaseCon 2015: HBase Operations in a Flurry
 
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...
February 2016 HUG: Apache Kudu (incubating): New Apache Hadoop Storage for Fa...
 
HBase at Flurry
HBase at FlurryHBase at Flurry
HBase at Flurry
 

Destaque

hockey fundraiser
hockey fundraiserhockey fundraiser
hockey fundraiserspredslide
 
hockey fundraiser
hockey fundraiserhockey fundraiser
hockey fundraiserspredslide
 
here's my title
here's my titlehere's my title
here's my titlespredslide
 
slide share presentation
slide share presentationslide share presentation
slide share presentationspredslide
 
Regression Test Old ETL
Regression Test Old ETLRegression Test Old ETL
Regression Test Old ETLspredslide
 
outgoing again
outgoing againoutgoing again
outgoing againspredslide
 
Presentation test
Presentation testPresentation test
Presentation testspredslide
 

Destaque (8)

hockey fundraiser
hockey fundraiserhockey fundraiser
hockey fundraiser
 
hockey fundraiser
hockey fundraiserhockey fundraiser
hockey fundraiser
 
here's my title
here's my titlehere's my title
here's my title
 
slide share presentation
slide share presentationslide share presentation
slide share presentation
 
Regression Test Old ETL
Regression Test Old ETLRegression Test Old ETL
Regression Test Old ETL
 
outgoing again
outgoing againoutgoing again
outgoing again
 
Presentation test
Presentation testPresentation test
Presentation test
 
Title
TitleTitle
Title
 

Semelhante a Presentation title

ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...
ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...
ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...Data Con LA
 
admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)Anower Perves
 
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching Solution
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching SolutionAdaptec’s maxCache™ 3.0 Read and Write SSD Caching Solution
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching SolutionAdaptec by PMC
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at PollfishPollfish
 
x86-less ScyllaDB: Exploring an All-ARM Cluster
x86-less ScyllaDB: Exploring an All-ARM Clusterx86-less ScyllaDB: Exploring an All-ARM Cluster
x86-less ScyllaDB: Exploring an All-ARM ClusterScyllaDB
 
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBBenchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBAthiq Ahamed
 
cassandra
cassandracassandra
cassandraAkash R
 
Power Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS CloudPower Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS CloudEdureka!
 
Load Testing Cassandra Applications
Load Testing Cassandra Applications Load Testing Cassandra Applications
Load Testing Cassandra Applications Instaclustr
 
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016DataStax
 
Enterprise Storage NAS - Dual Controller
Enterprise Storage NAS - Dual ControllerEnterprise Storage NAS - Dual Controller
Enterprise Storage NAS - Dual ControllerFernando Barrientos
 
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...DataStax
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and ScalabilityAlachisoft
 
Cassandra - A Basic Introduction Guide
Cassandra - A Basic Introduction GuideCassandra - A Basic Introduction Guide
Cassandra - A Basic Introduction GuideMohammed Fazuluddin
 

Semelhante a Presentation title (20)

Cassandra Database
Cassandra DatabaseCassandra Database
Cassandra Database
 
ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...
ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...
ScyllaDB: What could you do with Cassandra compatibility at 1.8 million reque...
 
admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)admina (an open-source administration tool for Apache Cassandra)
admina (an open-source administration tool for Apache Cassandra)
 
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching Solution
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching SolutionAdaptec’s maxCache™ 3.0 Read and Write SSD Caching Solution
Adaptec’s maxCache™ 3.0 Read and Write SSD Caching Solution
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at Pollfish
 
Cassandra at Pollfish
Cassandra at PollfishCassandra at Pollfish
Cassandra at Pollfish
 
Cassandra tutorial
Cassandra tutorialCassandra tutorial
Cassandra tutorial
 
x86-less ScyllaDB: Exploring an All-ARM Cluster
x86-less ScyllaDB: Exploring an All-ARM Clusterx86-less ScyllaDB: Exploring an All-ARM Cluster
x86-less ScyllaDB: Exploring an All-ARM Cluster
 
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDBBenchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
Benchmarking Top NoSQL Databases: Apache Cassandra, Apache HBase and MongoDB
 
cassandra
cassandracassandra
cassandra
 
Power Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS CloudPower Hadoop Cluster with AWS Cloud
Power Hadoop Cluster with AWS Cloud
 
Load Testing Cassandra Applications
Load Testing Cassandra Applications Load Testing Cassandra Applications
Load Testing Cassandra Applications
 
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016
Load Testing Cassandra Applications (Ben Slater, Instaclustr) | C* Summit 2016
 
Enterprise Storage NAS - Dual Controller
Enterprise Storage NAS - Dual ControllerEnterprise Storage NAS - Dual Controller
Enterprise Storage NAS - Dual Controller
 
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
Maximum Overdrive: Tuning the Spark Cassandra Connector (Russell Spitzer, Dat...
 
Four Ways to Improve ASP .NET Performance and Scalability
 Four Ways to Improve ASP .NET Performance and Scalability Four Ways to Improve ASP .NET Performance and Scalability
Four Ways to Improve ASP .NET Performance and Scalability
 
Cassandra - A Basic Introduction Guide
Cassandra - A Basic Introduction GuideCassandra - A Basic Introduction Guide
Cassandra - A Basic Introduction Guide
 
Series7Q Datasheet
Series7Q DatasheetSeries7Q Datasheet
Series7Q Datasheet
 
Introduction to Galera Cluster
Introduction to Galera ClusterIntroduction to Galera Cluster
Introduction to Galera Cluster
 
Cassandra Redis
Cassandra RedisCassandra Redis
Cassandra Redis
 

Presentation title

  • 1. Administrator Training with Apache Cassandra Tuning Datastax Inc. http://www.datastax.com/ August 27, 2012 Datastax Inc. Administrator Training with Apache Cassandra 1/ 24
  • 2. Outline 1 Overview 2 Cache 3 Summary Datastax Inc. Administrator Training with Apache Cassandra 2/ 24
  • 3. Tuning Cassandra Effective tuning depends on your use case What operations are performed? What does your data look like? Wide Rows Skinny Rows Datastax Inc. Administrator Training with Apache Cassandra 3/ 24
  • 4. Outline 1 Overview 2 Cache 3 Summary Datastax Inc. Administrator Training with Apache Cassandra 4/ 24
  • 5. Tuning the Cache Cassandra’s Cache is VERY efficient Takes lessons from dedicated caches Solve cache coherence issues Remove tiers from the application Cache never needs to be completely cold Datastax Inc. Administrator Training with Apache Cassandra 5/ 24
  • 6. Row Cache Return whenever possible A hit will never seek Datastax Inc. Administrator Training with Apache Cassandra 6/ 24
  • 7. Key Cache Used if Row Cache misses Key → SSTable is not 1:1 Each hit saves 1 seek Populated from a miss Datastax Inc. Administrator Training with Apache Cassandra 7/ 24
  • 8. Key Cache(cont.) Map of (key, list<(sstable, location)>) Per ColumnFamily Large numbers of rows accessed frequently Adjust by changing keys_cached on the ColumnFamily Datastax Inc. Administrator Training with Apache Cassandra 8/ 24
  • 9. Adjusting the Key Cache [ cassandra-cli to adjust the key cache] [default@demo] UPDATE COLUMN FAMILY users WITH keys_cached= Datastax Inc. Administrator Training with Apache Cassandra 9/ 24
  • 10. Monitor Key Cache nodetool cfstats RecentHitRate (jmx) Datastax Inc. Administrator Training with Apache Cassandra 10/ 24
  • 11. Monitor Key Cache nodetool cfstats RecentHitRate (jmx) Datastax Inc. Administrator Training with Apache Cassandra 11/ 24
  • 12. Configuring Row Cache Put the entire row in memory This can be harmful Disabled by default Disable it for ColumnFamilies with wide rows Now stored off-heap Datastax Inc. Administrator Training with Apache Cassandra 12/ 24
  • 13. Candidate Column Families for Row Cache Accesses a small subset of rows All, or most columns are returned Used properly improvement is substantial Datastax Inc. Administrator Training with Apache Cassandra 13/ 24
  • 14. Adjusting the Row Cache [ cassandra-cli to adjust the key cache] [default@demo] UPDATE COLUMN FAMILY users WITH rows_cached= AND row_cache_provider=’SerializingCacheProvider’; Datastax Inc. Administrator Training with Apache Cassandra 14/ 24
  • 15. Monitor Row Cache nodetool cfstats RecentHitRate (jmx) Datastax Inc. Administrator Training with Apache Cassandra 15/ 24
  • 16. Data Modeling Considerations Logical separation of workloads Read heavy Write heavy Narrow Rows, Frequently Accessed Normal (Gaussian) distributions work well A few ’Hot’ rows Datastax Inc. Administrator Training with Apache Cassandra 16/ 24
  • 17. Hardware and OS Large number of nodes under light load Ideal for in memory cache OS Page Cache Lower memtable size Lower heap size Balanced need heap memtables cache Datastax Inc. Administrator Training with Apache Cassandra 17/ 24
  • 18. Estimating Cache Sizes nodetool cfstats Number of keys cached * average key size Number of rows cached * average row size Datastax Inc. Administrator Training with Apache Cassandra 18/ 24
  • 19. Write Performance Write-back cache Thresholds are per-node PerCF thresholds have been deprecated commit_log_total_space_in_mb memtable_total_space_in_mb memtable_flush_queue_size (for secondary indexes) Datastax Inc. Administrator Training with Apache Cassandra 19/ 24
  • 20. Java Heap Size Default 1/4 of the memory 1GB - 8GB Little to negative benefit ¿ 8GB Heap (memtable_total_space_in_mb) + 1GB + (key_cache_size_e Datastax Inc. Administrator Training with Apache Cassandra 20/ 24
  • 21. Garbage Collection Log Information when GC ¿ 200ms Add Nodes Decrease key-cache size index_interval default 128, 256, 512 Datastax Inc. Administrator Training with Apache Cassandra 21/ 24
  • 22. Compaction multithreaded_compaction compaction_throughput_mb_per_sec in_memory_compaction_limit_in_mb compaction_preheat_key_cache Datastax Inc. Administrator Training with Apache Cassandra 22/ 24
  • 23. Outline 1 Overview 2 Cache 3 Summary Datastax Inc. Administrator Training with Apache Cassandra 23/ 24
  • 24. Overview Lots of Options Dependent on your use case Cache IO Datastax Inc. Administrator Training with Apache Cassandra 24/ 24