微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Cassandra 4.0 中缺少 CounterMutationStage 和 ViewMutationStage 指标

如何解决Cassandra 4.0 中缺少 CounterMutationStage 和 ViewMutationStage 指标

在 Cassandra 4.0 上调用 nodetool tpstats 时,这是我得到的 nodetool result screenshot

但是没有找到 CounterMutationStage 和 ViewMutationStage。他们在哪里?

解决方法

那些指标仍然存在。但问题是他们“懒惰”地公开数据。这基本上意味着,当值为零时它们根本不会显示。一旦您开始写入计数器或视图,这些指标就会执行它们的“延迟初始化”,然后才会公开。我使用 Cassandra 4.0 beta4 对此进行了测试。

运行基线 nodetool tpstats | head -n 4

Pool Name                    Active Pending Completed Blocked All time blocked
MutationStage                0      0       1         0       0
ReadStage                    0      0       27        0       0
CompactionExecutor           0      0       41        0       0

接下来,我将创建一个简单的计数器表。

CREATE TABLE games_popularity (game text PRIMARY KEY,popularity counter);

我会将计数器递增几次并SELECT

aploetz@cqlsh> SELECT * FROM stackoverflow.games_popularity ;

 game           | popularity
----------------+------------
 Cyberpunk 2077 |          3

(1 rows)

现在重新运行 nodetool tpstats | head -n 4 确实显示 CounterMutationStage

Pool Name                    Active Pending Completed Blocked All time blocked
MutationStage                0      0       12        0       0
CounterMutationStage         0      0       3         0       0
ReadStage                    0      0       96        0       0

请注意,在 4.0 中,这些指标也在 system_view.thread_pools 虚拟表中公开,您可以使用 SELECT * FROM system_views.thread_pools; 查看。

,

感谢 Cassandra 开发人员所做的出色工作,现在可以延迟初始化指标以提高性能。

“唤醒”所有惰性指标的最佳方法是:

nodetool getconcurrency

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。