question

satvantsingh_190085 avatar image
satvantsingh_190085 asked Erick Ramirez commented

How we can identify and kill a long-running query?

How to kill running query which is affecting my cluster performance badly .

cassandraperformance
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

1 Answer

Erick Ramirez avatar image
Erick Ramirez answered Erick Ramirez commented

It isn't possible to kill long-running queries in C* since each query runs in a thread (not a separate process) and is executed in several replicas for any consistency level higher than one.

You can only determine the queries hitting your cluster if you have audit logging enabled. In Cassandra, this isn't enabled by default because it is expensive and has a significant effect on the performance of your cluster. It isn't easy to quantify the impact of audit logging because it depends on a lot of moving parts including use case, data model, access patterns, hardware configuration, etc.

Cassandra also logs slow queries by default. Queries are considered slow if they take longer than the slow query timeout in cassandra.yaml:

slow_query_log_timeout_in_ms: 500

For details, see How to I collect slow queries in Apache Cassandra 3.11.6. Cheers!

2 comments Share
10 |1000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

satvantsingh_190085 avatar image satvantsingh_190085 commented ·

I understand for future we can identified bad query and tune.

But still if we have to get rid of that query at run time , what we can do as a admin ?

0 Likes 0 ·
Erick Ramirez avatar image Erick Ramirez ♦♦ satvantsingh_190085 commented ·

Again, you can't kill in-flight queries other than restarting Cassandra on a node. Cheers!

0 Likes 0 ·