在 Cassandra 4.0 上调用nodetool tpstats
时,这是我得到的 nodetool 结果截图
但是没有找到 CounterMutationStage 和 ViewMutationStage。他们在哪里?
在 Cassandra 4.0 上调用nodetool tpstats
时,这是我得到的 nodetool 结果截图
但是没有找到 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