我有一个3节点的Cassandra v3.11.4集群。复制因子=3,每个群集中约70 in的数据。
节点硬件: m5.2xlarge (8 vCPU,32 GB内存,500 GB固态硬盘)
一些YAML值:
num_tokens: 256
concurrent_reads: 32
concurrent_writes: 32
concurrent_counter_writes: 32
endpoint_snitch: SimpleSnitch来自负载均衡计算引擎的PHP连接:
$cluster = Cassandra::cluster()->withPort(PORT)->withDefaultConsistency(Cassandra::CONSISTENCY_LOCAL_QUORUM)->withContactPoints(HOST_VAL)->withIOThreads(5)->withCredentials(CASS_USER, CASS_PASS)->build();
$session = $cluster->connect(KEYSPACE);
$statement = $session->prepare($query);
$stmt = $session->execute($statement, ['arguments' => $bindParams]);Cassandra服务在大部分时间内都运行得很顺利,但是每隔5-6个小时就会出现5-10分钟的PHP操作错误:
Cassandra\Exception\RuntimeException: All connections on all I/O threads are busy
Cassandra\Exception\RuntimeException: All hosts in current policy attempted and were either unavailable or failed
Cassandra\Exception\TimeoutException: Request timed out
我猜问题出在PHP连接导致Cassandra节点停滞或生成过多连接。
请告诉我在哪里寻找可能的原因,或者是否有任何类似SHOW PROCESSLIST的命令来监控当前的连接,就像在MySQL中一样。
发布于 2021-09-05 01:54:29
这些错误表明节点正在过载并变得无响应,从而导致TimeoutException --副本在请求超时时间内不会响应协调器。
当节点繁忙时,请求排队等待服务。当队列达到最大大小时,来自客户端的任何新请求都不再排队。
检查表示节点过载的长GC。将这些时间与应用程序的读/写流量关联起来(您将从应用程序监控中获得这些指标)。
我的猜测是,您的应用程序没有平稳的流量,而是每隔几个小时就会达到峰值。正是在应用程序流量高峰期,集群才会超载。如果是这种情况,您需要通过添加更多节点来调整集群大小,以应对峰值流量。干杯!
https://stackoverflow.com/questions/69058390
复制相似问题