2

I am using Datastax python driver version:3.23

Cassandra version: DSE version 5.1.16

The output from cqlsh gives the following:

[cqlsh 5.0.1 | Cassandra 3.11.3.5116 | DSE 5.1.16 | CQL spec 3.4.4 | Nativeprotocol v4]

cluster = Cluster(['X.X.X.X'],port=9042,auth_provider=provider,protocol_version=4)
max_requests = cluster.get_max_requests_per_connection(0)
max_connections = cluster.get_max_connections_per_host(0)
print(max_connections)
print(max_requests)

Output:-

8 100

Based on the DataStax documentation max_request_per_host in v4 should be 32,786.

Not sure where is the problem.

Found similar issue for java drive.

Andre Nevares
  • 711
  • 6
  • 21
Babu
  • 21
  • 1

1 Answers1

2

32k of requests per connection is the theoretical maximum - it's not the actual number. Each driver has some constant as max number of the requests per connection. For example, Java driver allows 1024 request per connection, C# - 2048, etc.

You can increase this value by using cluster.set_max_requests_per_connection for Python driver, or corresponding functions in other drivers. But I don't recommend heavily increase of it - if you have too many in-flight requests, this is a sign that your cluster can't cope with the load, and by increasing the setting you're just hiding the real problem.

Alex Ott
  • 80,552
  • 8
  • 87
  • 132
  • I tried to set max_requests using cluster,set_max_requests_per_connection(0,100). It throws an error- has an effect when using protocol_version 1 or 2. I have gone through the source code of python driver, observed set parameters is not supported in NTP version > 2. However, I am able to manually pass lower version using cluster =Cluster(['x.x.x.x'],protocol_version=2). Is there any specific reason for deprecating this feature in python driver. Does this applicable to java driver too. – Babu Jun 11 '20 at 04:30