cassandra python驱动程序协议版本和连接限制不匹配

a0x5cqrl  于 2021-06-13  发布在  Cassandra
关注(0)|答案(1)|浏览(382)

我正在使用python驱动程序version:3.23
cassandra版本:dse版本5.1.16

来自cqlsh的输出给出以下结果: [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
根据税务文件 `max_request_per_host in v4` 应该是32786。
不知道哪里出了问题。
发现java驱动器存在类似问题。
xtupzzrd

xtupzzrd1#

每个连接的32k请求数是理论上的最大值,而不是实际数。每个驱动程序都有一些常量作为每个连接的最大请求数。例如,java驱动程序允许每个连接有1024个请求,c#-2048等等。
您可以使用 cluster.set_max_requests_per_connection 用于python驱动程序,或其他驱动程序中的相应函数。但是我不建议过多地增加它—如果您有太多的运行中请求,这表明您的集群无法处理负载,通过增加设置,您只是隐藏了真正的问题。

相关问题