We recently migrated from Cassandra to AWS Keyspaces and I am just wondering how to check for table and keyspace total size in AWS keyspaces. Any help or suggestions are much appreciated.
3 Answers
currently there is no direct way to get the keyspace/table storage metrics, but you can certainly calculate the storage size if you are aware of no.of rows in the table
size of each row is calculate based on
partition key columns + clustering columns + regular columns + row metadata = total encoded size of row
for more info on how to calculate refer
https://docs.aws.amazon.com/keyspaces/latest/devguide/working-with-rows.html#calculating-row-size
https://docs.aws.amazon.com/keyspaces/latest/devguide/cql.elements.html#cql.data-types
FYI you will be able to see the storage in the cost explorer

- 43
- 7
Now, you can use the BillableTableSizeInBytes CloudWatch metric to monitor and track your table storage costs over time. The BillableTableSizeInBytes metric provides the billable storage size of a table by summing up the encoded size of all the rows in the table.
Additionally, its easy to aggregate this into a keyspace using cloudwatch metric math.
SUM(SEARCH('{AWS/Cassandra,Keyspace,TableName} Keyspace="tlp_stress" MetricName="BillableTableSizeInBytes"', 'Average', 300))
You can find pre-built dashboard for a keyspace and table in the following git repository. By using the cloudformation template provided you can create a new dashboard quickly. https://github.com/aws-samples/amazon-keyspaces-cloudwatch-cloudformation-templates

- 764
- 3
- 14
i guess you have multiply number of rows * row_size https://docs.aws.amazon.com/keyspaces/latest/devguide/working-with-rows.html#calculating-row-size

- 66
- 1
- 10