bin/cqlsh
tracing on
select * from cluster_test.test where key=' 1' ;
bin/cqlsh
Connected to Test Cluster at 127.0.0.1:9042.
[cqlsh 5.0.1 | Cassandra 3.11.2 | CQL spec 3.4.4 | Native protocol v4]
Use HELP for help.
cqlsh> tracing on;
Now Tracing is enabled
cqlsh> select * from cluster_test.test where key=' 1' ;
key | value
-----+-------
1 | works
(1 rows)
Tracing session: 449e8470-854f-11e8-b6f9-87e0f2d93c64
activity | timestamp | source | source_elapsed | client
--------------------------------------------------------------------------------------+----------------------------+-----------+----------------+-----------
Execute CQL3 query | 2018-07-11 14:13:33.495000 | 127.0.0.1 | 0 | 127.0.0.1
Parsing select * from cluster_test.test where key=' 1' ; [Native-Transport-Requests-1] | 2018-07-11 14:13:33.495000 | 127.0.0.1 | 790 | 127.0.0.1
Preparing statement [Native-Transport-Requests-1] | 2018-07-11 14:13:33.496000 | 127.0.0.1 | 1543 | 127.0.0.1
Executing single-partition query on test [ReadStage-3] | 2018-07-11 14:13:33.498000 | 127.0.0.1 | 3136 | 127.0.0.1
Acquiring sstable references [ReadStage-3] | 2018-07-11 14:13:33.498000 | 127.0.0.1 | 3398 | 127.0.0.1
Merging memtable contents [ReadStage-3] | 2018-07-11 14:13:33.498000 | 127.0.0.1 | 3615 | 127.0.0.1
Key cache hit for sstable 2 [ReadStage-3] | 2018-07-11 14:13:33.499000 | 127.0.0.1 | 4010 | 127.0.0.1
Read 1 live rows and 0 tombstone cells [ReadStage-3] | 2018-07-11 14:13:33.500000 | 127.0.0.1 | 4975 | 127.0.0.1
Request complete | 2018-07-11 14:13:33.500587 | 127.0.0.1 | 5587 | 127.0.0.1
cqlsh>
bin/nodetool tablehistograms cluster_test.test
bin/nodetool tablehistograms cluster_test.test
cluster_test/test histograms
Percentile SSTables Write Latency Read Latency Partition Size Cell Count
(micros) (micros) (bytes)
50% 1.00 0.00 1955.67 29 1
75% 1.00 0.00 1955.67 29 1
95% 1.00 0.00 1955.67 29 1
98% 1.00 0.00 1955.67 29 1
99% 1.00 0.00 1955.67 29 1
Min 1.00 0.00 1629.72 25 0
Max 1.00 0.00 1955.67 29 1
ALTER TABLE cluster_test.test WITH caching = {' keys' : ' ALL' , ' rows_per_partition' : ' 1000' };
Check for Compactions / Trigger it
bin/nodetool compact cluster_test
bin/nodetool compactionstats
ALTER TABLE cluster_test.test WITH compaction = {' class' : ' LeveledCompactionStrategy' };
ALTER TABLE cluster_test.test WITH bloom_filter_fp_chance = 0.5;
bin/nodetool compact cluster_test
More on:
https://docs.datastax.com/en/cql/3.3/cql/cql_reference/cqlshTracing.html
https://lostechies.com/ryansvihla/2014/09/22/cassandra-query-patterns-not-using-the-in-query-for-multiple-partitions/
https://medium.com/linagora-engineering/tunning-cassandra-performances-7d8fa31627e3
https://docs.datastax.com/en/cassandra/3.0/cassandra/operations/opsSetCaching.html
https://docs.datastax.com/en/archived/cassandra/1.2/cassandra/operations/ops_tuning_bloom_filters_c.html