bhomass
bhomass

Reputation: 3572

cassandra key cache hit rate differs between nodetool and opscenter

I checked my key cache hit rate via nodetool and opscenter, the first shows a hit rate of 0.907 percent.

Key Cache : entries 1152104, size 96.73 MB, capacity 100 MB, 52543777 hits, 57954469 requests, 0.907 recent hit rate, 14400 save period in seconds

but in opscenter the graph shows 100%. enter image description here

any one understands why the difference?

Upvotes: 0

Views: 1480

Answers (1)

Chris Lohfink
Chris Lohfink

Reputation: 16410

Cassandra has a perhaps bug (or at least typo) here, it lists it as recent hit cache but its of all time:

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

Its grabbing the value of the "total" hitrate:

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

So although you may be getting 100% hit rate for the last 19 minutes according to opscenter it wasn't always 100%. The total number of hits / total number of requests of all time is ~90%.

This is shown from:

52543777 hits, 57954469 requests

52543777 / 57954469 = 0.907

Upvotes: 3

Related Questions