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

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

问题描述

使用此链接,我对Cassandra中的本机传输请求有一些了解:什么

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中出现请求超时错误,并且在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)什么是所有时间被阻止状态?

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阶段,然后移交给读取/变异阶段,但在等待完成时仍会阻塞。为了防止过载,该阶段开始阻止将任务添加到其队列以向客户端施加反压力。每次阻止请求时,所有时间阻止计数器都会递增。因此,由于必须备份许多请求,因此 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代理直方图。您的数据模型或查询中可能存在引起问题的东西。

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天全站免登陆