如何在cassandra中找到除system.log以外的大分区?

lb3vh1jj  于 2021-06-14  发布在  Cassandra
关注(0)|答案(2)|浏览(278)

在进入system.log之前,如何在cassandra集群中找到大分区?因此,我们面临一些性能问题。有人能帮我吗。我们有Cassandra版本2.0.11和2.1.16。

pu3pd22g

pu3pd22g1#

您可以查看 nodetool tablestats (或 nodetool cfstats 在旧版本的cassandra中)-对于每个表,它都有行压缩的分区最大字节数以及其他信息,如本例中的最大分区大小约为268mb:

Table: table_name
    SSTable count: 2
    Space used (live): 147638509
    Space used (total): 147638509
    .....
    Compacted partition minimum bytes: 43
    Compacted partition maximum bytes: 268650950
    Compacted partition mean bytes: 430941
    Average live cells per slice (last five minutes): 8256.0
    Maximum live cells per slice (last five minutes): 10239
    Average tombstones per slice (last five minutes): 1.0
    Maximum tombstones per slice (last five minutes): 1
    .....

但是 nodetool tablestats 只提供当前节点的信息,因此需要在集群的每个节点上执行它。
更新:您可以使用不同的工具找到最大的分区:
https://github.com/tolbertam/sstable-tools 具有显示最大/最宽分区的descripe命令。这个命令也可以在cassandra4.0中使用。
对于datastax产品,dsbulk工具支持分区计数。

py49o6xq

py49o6xq2#

尝试 nodetool tablehistograms -- <keyspace> <table> 命令提供有关表的统计信息,包括读/写延迟、分区大小、列计数和sstables数。
下面是输出示例:

Percentile  SSTables     Write Latency      Read Latency    Partition Size        Cell Count
                              (micros)          (micros)           (bytes)                  
50%             0.00             73.46              0.00         223875792             61214
75%             0.00             88.15              0.00         668489532            182785
95%             0.00            152.32              0.00        1996099046            654949
98%             0.00            785.94              0.00        3449259151           1358102
99%             0.00            943.13              0.00        3449259151           1358102
Min             0.00             24.60              0.00              5723                 4
Max             0.00           5839.59              0.00        5960319812           1955666

这提供了表的适当统计信息,比如95%的原始数据表的分区大小为107mb,最大为3.44gb。
希望这有助于解决性能问题。

相关问题