使用cfstats的cassandra表中键的最大大小
问题: 我想知道cassandra表中partitionKey数据的最大大小(和平均大小) 到目前为止我做了什么: cfstats提供了许多信息使用cfstats的cassandra表中键的最大大小,cassandra,size,usage-statistics,Cassandra,Size,Usage Statistics,问题: 我想知道cassandra表中partitionKey数据的最大大小(和平均大小) 到目前为止我做了什么: cfstats提供了许多信息 Keyspace: my_keyspace Read Count: 0 Read Latency: NaN ms. Write Count: 1 Write Latency: 0.289 ms. Pending Flushes: 0 Tabl
Keyspace: my_keyspace
Read Count: 0
Read Latency: NaN ms.
Write Count: 1
Write Latency: 0.289 ms.
Pending Flushes: 0
Table: my_table
SSTable count: 1
Space used (live): 63915
Space used (total): 63915
Space used by snapshots (total): 0
Off heap memory used (total): 258
SSTable Compression Ratio: 0.21345907193641897
Number of keys (estimate): 24
Memtable cell count: 13
Memtable data size: 406
Memtable off heap memory used: 0
Memtable switch count: 0
Local read count: 0
Local read latency: NaN ms
Local write count: 1
Local write latency: 0,289 ms
Pending flushes: 0
Bloom filter false positives: 0
Bloom filter false ratio: 0,00000
Bloom filter space used: 176
Bloom filter off heap memory used: 168
Index summary off heap memory used: 50
Compression metadata off heap memory used: 40
Compacted partition minimum bytes: 925
Compacted partition maximum bytes: 29521
Compacted partition mean bytes: 12935
对于平均大小,我认为“使用的空间”/“键数”是正确的选择
但是如何为每把钥匙获得更多的细节呢?(至少是最大大小)使用Java VisualVM可以找到更多的统计信息。您需要将远程JMX连接添加到cassandra节点(默认端口为7199)。然后进入
org.apache.cassandra.db/ColumnFamilies/my_keyspace/my_table
。有一个属性LiveCellsPerSlice
,您可能会发现它很有用。nodetool cfstats
为模式中的表提供了良好的摘要输出。通常,我会使用它来比较集群中给定表或键空间的值,例如,查看某些节点是否持有比其他节点多得多的键,或者可能显示更高的延迟。对于后者,我可以使用nodetool cfhistograms
放大它
spaceused
只是该节点上该表使用的空间,number of keys
是节点从该表中持有的分区键数量的估计值。对于分区大小,它不会显示给定键的实际大小,但会显示该表中分区键的最小值/平均值和最大值,这通常用于确定表中是否有可能变得过大的分区
这里的文档详细介绍了cfstats:
cfstats
在Cassandra 3.0中被tablestats
取代,这里的文档对字段的含义给出了很好的概述: