检查每个表上的cassandra负载

7gyucuyw  于 2021-06-10  发布在  Cassandra
关注(0)|答案(1)|浏览(417)

有没有办法计算出每个表上有多少请求(读/写)?
我在想我们哪里有很大的负担。
已尝试使用:

nodetool tablestats

不太好,因为我看不到请求的数量。
谢谢

ilmyapht

ilmyapht1#

tablestats 将为您提供可能足够的请求总数。还可以查看那里的平均本地读/写延迟以查找异常值。费率在jmx中公开,您可以从表度量中获取:http://cassandra.apache.org/doc/latest/operating/metrics.html#table-指标

org.apache.cassandra.metrics:type=Table keyspace=<Keyspace> scope=<Table> name=<MetricName>

Metric Name             Tye      Description
--------------------------------------------------------------------------
ReadLatency             Latency  Local read latency for this table.
RangeLatency            Latency  Local range scan latency for this table.
WriteLatency            Latency  Local write latency for this table.
CoordinatorReadLatency  Timer    Coordinator read latency for this table.
CoordinatorWriteLatency Timer    Coordinator write latency for this table.
CoordinatorScanLatency  Timer    Coordinator range scan latency for this table.

其中每个都有1、5和15分钟速率属性。
使用瑞士 java 刀:

java -jar sjk.jar mx -p {PID} -b org.apache.cassandra.metrics:type=ColumnFamily,keyspace=<Keyspace>,scope=<Table>,name=CoordinatorReadLatency --attribute FiveMinuteRate --get

(注意:以与您的cassandra示例运行时相同的用户身份运行它 sudo -u 或者它可能没有附加到jvm的权限)
如果它目前运行高负荷,你可以使用 toppartitions 或者 profileload . 在某些版本中,toppartitions要求您将表交给它。


# > nodetool profileload

Frequency of reads by partition:
   Table        Partition Count +/-
   basic.wide   row1      75424 0 
   basic.cas    p1        656   0
   system.paxos 7031      550   0 
   system.local local     2     0 

Frequency of writes by partition:
   Table        Partition Count +/-
   system.paxos 7031      585   0 
   basic.cas    p1        112   0 
   basic.wide   row4864   20    19
   basic.wide   row4870   20    19
   basic.wide   row4868   20    19
   basic.wide   row4871   20    19

Frequency of cas contentions by partition:
   Table     Partition Count +/-
   basic.cas p1        76    0 

Max mutation size by partition:
   Table      Partition Bytes
   basic.wide row0      1056
   basic.wide row7      1056
   basic.wide row11     1056
   basic.wide row59     1056
   basic.wide row255    1056

Longest read query times:
   Query                                                Microseconds
   SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 25681       
   SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 16131       
   SELECT * FROM basic.wide WHERE key = row1 LIMIT 5000 14715        
   SELECT * FROM system_schema.columns                  2784        
   SELECT * FROM system_schema.columns                  2285        
   SELECT * FROM system_schema.tables                   1553        
   SELECT * FROM system_schema.tables                   1275

相关问题