【发布时间】:2021-11-02 14:09:57
【问题描述】:
我有一个 3 节点 Cassandra v3.11.4 集群。复制因子 = 3,每个集群中大约有 70GB 数据。
节点硬件:m5.2xlarge(8 个 vCPU,32 GB RAM,500GB SSD)
一些 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 中。
【问题讨论】: