nodessol和opscenter之间的cassandra密钥缓存命中率不同

时间:2015-04-20 23:30:11

标签: caching cassandra opscenter nodetool

我通过nodetool和opscenter检查了我的密钥缓存命中率,第一次显示命中率为0.907%。

密钥缓存:条目1152104,大小96.73 MB,容量100 MB,52543777次点击,57954469次请求,0.907最近命中率,14400个保存期限(秒)

但在opscenter中,图表显示为100%。 enter image description here

任何人都明白为什么会有差异?

1 个答案:

答案 0 :(得分:3)

Cassandra在这里可能存在一个错误(或者至少是错字),它将其列为最近的命中缓存,但它始终是:

https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/tools/nodetool/Info.java#L95

它抓住了“总”命中率的价值:

https://github.com/apache/cassandra/blob/trunk/src/java/org/apache/cassandra/metrics/CacheMetrics.java#L66

因此,根据opscenter,你可能在过去的19分钟内获得100%的命中率,但并不总是100%。点击总数/所有时间的总请求数约为90%。

这显示于:

52543777 hits, 57954469 requests

52543777 / 57954469 = 0.907