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

2024-09-19 20:42:29 发布

您现在位置:Python中文网/ 问答频道 /正文

我使用的是Datastax python驱动程序版本:3.23

卡桑德拉版本: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)

输出:-

八, 一百

根据数据,税务文件max_request_per_host in v4应为32786

不知道问题出在哪里

Found similar issue for java drive.


Tags: 版本hostget驱动程序providerrequestsconnectionsmax
1条回答
网友
1楼 · 发布于 2024-09-19 20:42:29

每个连接32k的请求数是理论上的最大值,而不是实际数量。每个驱动程序都有一些常量作为每个连接的最大请求数。例如,Java驱动程序允许每个连接有1024个请求,C#-2048等等

您可以通过对Python驱动程序使用cluster.set_max_requests_per_connection或其他驱动程序中的相应函数来增加此值。但是我不建议大幅增加它——如果您有太多的飞行中请求,这表明您的集群无法处理负载,通过增加设置,您只是隐藏了真正的问题

相关问题 更多 >