Vishal Sharma
Vishal Sharma

Reputation: 1750

Configuring connection pooling in Cassandra using C++ driver

Although connection pooling has been mentioned as one of the features of the Cassandra's C++ driver(https://datastax.github.io/cpp-driver/), no details have been given regarding its implementation in C++. Can anybody help regarding the configuration of connection pools in the C++ program?

Upvotes: 1

Views: 403

Answers (1)

Alex Ott
Alex Ott

Reputation: 87234

For high-level description of what connection pooling is, you can use documentation from Java driver (unfortunately there is no corresponding documentation for C++ driver).

C++ driver also have slightly different configuration options - for example, there is only one configuration for number of connections, while Java driver allows to specify different numbers for local & remote clusters.

You can use function cass_cluster_set_core_connections_per_host to specify a minimal number of network connections to host, and cass_cluster_set_max_connections_per_host to specify maximal number of connections to host - driver will resize pool if necessary. And function cass_cluster_set_max_concurrent_requests_threshold specifies how many requests could be in-flight for one network connection. You can look to tests of C++ driver for examples.

But be very careful with changing these settings, as this may lead to increased resource consumption.

Upvotes: 2

Related Questions