Bringing together the Apache Cassandra experts from the community and DataStax.

Want to learn? Have a question? Want to share your expertise? You are in the right place!

Not sure where to begin? Getting Started

 

question

mishra.anurag643_153409 avatar image
mishra.anurag643_153409 asked ·

How do I get the table size in Cassandra?

I am trying to get total space used by a cassandra table . I have run cfstats command and its output has Space used (total) field , but I am not pretty sure if space used by table also includes space occupied by replicas too . and also does space mentioned is in bytes ?

cassandra
10 |1000 characters needed characters left characters exceeded

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 ·

There isn't a utility for that so you'll need to do some manual calculations using the value in the nodetool tablestats (previously cfstats) output.

For example if you had a 6-node DC with a replication factor of 3 and each node had about 100GB of data each, the total size is:

table_size = ( 100GB + 100GB + 100GB + 100GB + 100GB + 100GB ) / 3
           = 600GB / 3
           = 200GB

And yes, the units in the output is in bytes. Cheers!

Share
10 |1000 characters needed characters left characters exceeded

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