How many parallel write requests can a single Node.js driver connection process?

434 views Asked by At

How many parallel write requests can I make to cassandra from a single connection in a nodejs process?

I am using: [email protected] : https://www.npmjs.com/package/cassandra-driver I am not using batch... as i understand it is not recommended if all data is not in same partition.

My main concern is limitation if any from cassandra connection point of view..

From: Understand Cassandra pooling options (setCoreConnectionsPerHost and setMaxConnectionsPerHost)? I understand that 32k parallel write is approx limit

2

There are 2 answers

3
Alex Ott On BEST ANSWER

32k is the theoretical upper limit on the number of queries in-flight, but the real number heavily depends on the size of the cluster, how load is spread between nodes, etc. Sometimes, having more in-flight requests will put an additional load onto the cluster, and your latencies will be heavily increasing.

As I mentioned in that answer, it's recommended to test your setup & find optimal number of requests per connection. You can use NoSQLBench tool to find optimal configurations.

0
Erick Ramirez On

For the Node.js driver, the maximum requests per connection for native protocol v3 or newer is 2048 by default (for older native protocols v1 and v2 it's just 128).

It's not 32K as you quoted. The other post you linked isn't relevant to your question since it applies to the Cassandra Java driver.

For details, see Connection pooling with the Node.js driver. Cheers!