KB Article #179673

Cassandra healthcheck

Problem

Cassandra performance has deteriorated especially under load and the setup needs to be checked.

Resolution

Note the best practices section in the Cassandra Administrator Guide which contains some useful recommendations ...

API Gateway 7.6.2 Apache Cassandra Administrator Guide

Here is a useful script to gather some important information from Cassandra nodes whenever investigating a performance type of issue.

The script should be run at the time the problem is observed on each host in the cluster and possibly run at intervals so changes over time can be investigated.

#!/bin/bash

prefix=$(hostname -i)_$(date +%Y%m%d_%H%M.%S)

echo "Gathering process status"
cat /proc/"$(pgrep -f cassandra)"/status > "${prefix}"_status.log
top -n1 > "${prefix}"_top.log
free -m > "${prefix}"_free.log

echo "Gathering Cassandra cfstats"
nodetool cfstats > "${prefix}"_cfstats.log

echo "Gathering Cassandra status"
nodetool status > "${prefix}"_status.log

echo "Gathering Cassandra tpstats"
nodetool tpstats > "${prefix}"_tpstats.log

echo "DONE"
echo