pythoncassandracqlcassandra-driver

Prevent Cassandra Query benefiting from caching


I am attempting to get some metrics for my Cassandra cluster. As such, I want to see how queries perform when they are run the first time, without the benefit of caching. Is there a way to disable the cache on a per-query basis, and if there is not is it possible to disable it on a per-table basis?

For the table in question, it was created with the caching property

AND caching = {
    'keys' : 'NONE',
    'rows_per_partition' : 'NONE'
}

but based on the output the later issues of the same query are obviously receiving caching benefits.


Solution

  • Beside the caching configuration in the table, that you have already done, you should ensure that in the cassandra.yaml configuration file, the value for row_cache_size_in_mb is zero (0). If you need to change this value keep in mind that you need to do the change in each node and restart them, one node at a time.