Search code examples
cassandradatastaxcassandra-3.0

Relation between system specifications and Cassandra configuration parameters


Is there a relation between Cassandra's configuration parameters(given below with current values), Datastax's C++ driver configuration parameters(given below with current values) and the node's hardware specifications(no. of processors, RAM, no. of disks etc.)

Cassandra's Configuration Parameters(in 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's C++ Driver Configuration Parameters

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

Node's specs

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

I have a cluster of 2 nodes and I've been getting dismal throughput(12000 ops/second). 1 operation = read + write(I can't use row cache). Is there any parameter which should've been set higher/lower(considering the nodes' specs)?

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.


Solution

  • Some of the configuration properties in Cassandra are computed from available CPU cores and drives.

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

    It looks like you've done that, although I would question whether or not your 32 CPUs are all physical cores, or hyper-threaded.

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

    Just my opinion, but I think 12k ops/sec is pretty good. Actually REALLY good for a two node cluster. Cassandra scales horizontally, and linearly at that. So the solution here is an easy one...add more nodes.

    What is your target operations per second? Right now, you're proving that you can get 6k ops/second per node. Which means, if you add another, the cluster should support 18K/sec. If you go to six nodes, you should be able to support 36k/sec. Basically, figure out your target, and do the math.

    One thing you might consider, is to try ScyllaDB. Scylla is a drop-in replacement for Cassandra, which trumpets the ability to hit very high throughput requirements. The drawback, is that I think Scylla is only Cassandra 2.1 or 2.2 compatible ATM. But it might be worth a try based on what you're trying to do.