Cassandra 中的本地传输请求 [英] Native Transport Requests in Cassandra

查看:21
本文介绍了Cassandra 中的本地传输请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用此链接获得了有关 Cassandra 中的本地传输请求的一些观点:WhatCassandra 中的本地传输请求是什么?

I got some points about Native Transport Requests in Cassandra using this link : What are native transport requests in Cassandra?

根据我的理解,我在 Cassandra 中执行的任何查询都是本地传输请求.

As per my understanding, any query I execute in Cassandra is an Native Transport Requests.

我经常在 Cassandra 中收到 Request Timed Out 错误,我在 Cassandra 调试日志 以及使用 nodetool tpstats 时观察到以下日志

I frequently get Request Timed Out error in Cassandra and I observed the following logs in Cassandra debug log and as well as using nodetool tpstats

/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

1) 什么是 All time blocks 状态?
2) 这个值是什么:1063468 表示?危害有多大?
3) 如何调整?

1) What is the All time blocked state?
2) What is this value : 1063468 denotes? How harmful it is?
3) How to tune this?

推荐答案

每个请求都由 NTR 阶段处理,然后再移交到读取/变异阶段,但在等待完成时仍然阻塞.为了防止过载,阶段开始阻止将任务添加到其队列以向客户端施加背压.每次请求被阻塞时,all time blocks 计数器都会增加.所以 1063468 请求曾经因为备份了很多请求而被阻塞了一段时间.

Each request is taken processed by the NTR stage before being handed off to read/mutation stage but it still blocks while waiting for completion. To prevent being overloaded the stage starts to block tasks being added to its queue to apply back pressure to client. Every time a request is blocked the all time blocked counter is incremented. So 1063468 requests have at one time been blocked for some period of time due to having to many requests backed up.

在应用程序有查询高峰的情况下,这种阻塞是不必要的,并且可能会导致问题,因此您可以使用诸如 -Dcassandra.max_queued_native_transport_requests=4096(默认 128)之类的内容来增加此队列限制.您也可以在客户端限制请求,但首先尝试增加队列大小.

In situations where the app has spikes of queries this blocking is unnecessary and can cause issues so you can increase this queue limit with something like -Dcassandra.max_queued_native_transport_requests=4096 (default 128). You can also throttle requests on client side but id try increasing queue size first.

也可能有一些非常缓慢的请求阻塞了您的系统.如果您有监控设置,请查看高百分比读/写协调器延迟.您还可以使用 nodetool proxyhistograms.您的数据模型或查询中可能存在导致问题的内容.

There also may be some request thats exceptionally slow that is clogging up your system. If you have monitoring setup, look at high percentile read/write coordinator latencies. You can also use nodetool proxyhistograms. There may be something in your data model or queries that is causing issues.

这篇关于Cassandra 中的本地传输请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆