How to know the size of a keyspace and column family in Cassandra?

JavaRookie picture JavaRookie · Nov 19, 2014 · Viewed 30.8k times · Source

Recently I've started working on Grails integration with Cassandra using the Java driver for cassandra(cassandra-driver-core-2.0.2). So I was curious to know how we can find out how much size our table is taking to store the data in cassandra DB.

I have created a keyspace with name Customkeyspace and a column family called Movie in it. So I was curious to know which tool/Command I have to use to know the size of the keyspace/Column family ?

Answer

Erick Ramirez picture Erick Ramirez · Nov 19, 2014

To get statistics regarding column families in Cassandra, you can simply run the command:

nodetool cfstats

It reports statistics about tables which include the live data size as well as on disk.

The documentation about this utility for Cassandra 2.1 is available here.