系统规格和 Cassandra 配置参数之间的关系

Relation between system specifications and Cassandra configuration parameters

Cassandra 的配置参数(下面给出当前值)、Datastax 的 C++ 驱动程序配置参数(下面给出当前值)和节点的硬件规格(处理器数量、RAM、磁盘数量)之间是否存在关系等等)

Cassandra 的配置参数(在 YAML 中)

concurrent_reads set as 16
concurrent_writes set as 256
native_transport_max_threads set as 256
native_transport_max_frame_size_in_mb set as 512

Datastax 的 C++ 驱动程序配置参数

cass_cluster_set_num_threads_io set as 10
cass_cluster_set_core_connections_per_host set as 1
cass_cluster_set_max_connections_per_host set as 20
cass_cluster_set_max_requests_per_flush set as 10000

节点规格

No. of processors: 32
RAM: >150 GB
No. of hard disks: 1

Cassandra's Version: 3.11.2 Datastax C++ driver version: 2.7 RHEL version: 6.5

我有一个由 2 个节点组成的集群,但吞吐量一直很低 (12000 ops/second)。 1 次操作 = 读 + 写(我不能使用行缓存)。是否有任何应该设置的参数 higher/lower(考虑到节点的规格)?

Please also note that my read+write application is multi-threaded(10 threads). Also, I'm doing asynchronous read+ asynchronous write(using future). Replication factor is 2, both nodes are in the same DC, consistency level for both read and write is also 2.

Cassandra 中的某些配置属性是根据可用的 CPU 个内核和驱动器计算得出的。

concurrent_reads = 16 * (number of drives)
concurrent_writes = 8 * (CPU cores)

看起来你已经做到了,虽然我会质疑你的 32 CPU 是否都是物理内核,或者超线程。

I have a cluster of 2 nodes and I've been getting dismal throughput(12000 ops/second).

只是我的意见,但是 认为 12k ops/sec 相当不错。实际上 REALLY 适合双节点集群。 Cassandra 水平地、线性地扩展。所以这里的解决方案很简单...添加更多节点。

您每秒的目标操作数是多少?现在,您正在证明每个节点可以获得 6k ops/second。这意味着,如果您添加另一个,集群应该支持 18K/秒。如果你去六个节点,你应该可以支持 36k/sec。基本上,弄清楚你的目标,然后做数学。

您可能会考虑的一件事是尝试 ScyllaDB。 Scylla 是 Cassandra 的直接替代品,后者号称能够满足非常高的吞吐量要求。缺点是我认为 Scylla 只是 Cassandra 2.1 或 2.2 兼容的 ATM。但根据您要执行的操作,它可能值得一试。