Connection pooling

The DataStax drivers maintain a pool of connections to each of the nodes selected by the load balancing policy.

The DataStax drivers maintain a pool of connections to each of the DataStax nodes selected by the load balancing policy. By default, the driver instance creates one connection to each of the local datacenter hosts in the default load balancing policy.

Connection pooling is separate from the initial contact points. Initial contact points are supplied to the driver instance. Those contact points are used only to establish the control connection to discover the DSE cluster topology.

Connection pools are accessed asynchronously. Multiple requests can be submitted on a single connection simultaneously. For most workloads, it is recommended to use one long-lived connection from the driver to each DSE server. If the default connection pool settings are not adequate, the number of connections per host and the maximum number of simultaneous requests per connection are configurable. The DSE binary protocol allows up to 32768 concurrent requests per connection.

Table 1. Connection pools configuration
C/C++ C# Java Node.js PHP Python 1 Ruby2
1 Does not have ability to customize connections per host, single thread/GIL is limiting factor.
2 Search page for connections_per_local_node and requests_per_connection.