我在Cassandra中使用以下链接获得了有关本地传输请求的一些观点:What are native transport requests in Cassandra?
根据我的理解,我在Cassandra中执行的任何查询都是本机传输请求。
我经常在Cassandra中遇到请求超时错误,我在Cassandra 调试日志中观察到以下日志,并使用/var/log/cassandra# nodetool tpstats
Pool Name Active Pending Completed Blocked All time blocked
MutationStage 0 0 186933949 0 0
ViewMutationStage 0 0 0 0 0
ReadStage 0 0 781880580 0 0
RequestResponseStage 0 0 5783147 0 0
ReadRepairStage 0 0 0 0 0
CounterMutationStage 0 0 14430168 0 0
MiscStage 0 0 0 0 0
CompactionExecutor 0 0 366708 0 0
MemtableReclaimMemory 0 0 788 0 0
PendingRangeCalculator 0 0 1 0 0
GossipStage 0 0 0 0 0
SecondaryIndexManagement 0 0 0 0 0
HintsDispatcher 0 0 0 0 0
MigrationStage 0 0 0 0 0
MemtablePostFlush 0 0 799 0 0
ValidationExecutor 0 0 0 0 0
Sampler 0 0 0 0 0
MemtableFlushWriter 0 0 788 0 0
InternalResponseStage 0 0 0 0 0
AntiEntropyStage 0 0 0 0 0
CacheCleanupExecutor 0 0 0 0 0
Native-Transport-Requests 0 0 477629331 0 1063468
Message type Dropped
READ 0
RANGE_SLICE 0
_TRACE 0
HINT 0
MUTATION 0
COUNTER_MUTATION 0
BATCH_STORE 0
BATCH_REMOVE 0
REQUEST_RESPONSE 0
PAGED_RANGE 0
READ_REPAIR 0
All time blocked
1)1063468
状态是什么?
2)这个值是什么:df['time'][0:4]
2015-07-08
05-11
05-12
2008-07-26
表示?它有多危害?
3)如何调整这个?
谢谢,
哈利
答案 0 :(得分:2)
每个请求在被切换到读/突变阶段之前由NTR阶段处理,但在等待完成时仍然阻塞。为了防止过载,阶段开始阻止添加到其队列中的任务以向客户端施加反压。每次阻止请求时,all time blocked
计数器都会递增。因此,由于必须备份许多请求,1063468
个请求在一段时间内被阻止了一段时间。
在应用程序出现查询峰值的情况下,此阻止是不必要的,可能会导致问题,因此您可以使用-Dcassandra.max_queued_native_transport_requests=4096
(默认值为128)来增加此队列限制。您也可以在客户端限制请求但id尝试首先增加队列大小。
也可能有一些请求特别慢,这会堵塞你的系统。如果您有监控设置,请查看高百分位读/写协调器延迟。您也可以使用nodetool proxyhistograms
。您的数据模型或查询中可能存在导致问题的内容。