英文:
How do I set the maximum pool size in gocql?
问题
我想知道如何在gocql
中显式设置最大池大小?
我的意思是更改同时运行的查询数量。
我们在Grafana中的平均响应时间为200ms
,但在Cassansra导出面板中,我们看到的平均读取延迟为24ms
。这可能与池大小有关吗?
附注:我认为Java驱动程序中的函数是poolingOptions.setMaxRequestsPerConnection(num)
。在gocql中有相应的函数吗?
英文:
I wanted to know how can we explicitly set max pool size in gocql
?
I mean changing the number of queries which will be run simultaneously.
We are having 200ms
avg response time in Grafana, but we are seeing 24ms
avg read latency in Cassansra exporter panels. Can it be related to pool size?
P.S. I think that's the function in Java driver: poolingOptions.setMaxRequestsPerConnection(num)
. What is the equivalent function in gocql?
答案1
得分: 2
我认为在gocql中没有与Cassandra Java驱动程序的setMaxRequestsPerConnection()
等效的功能。
gocql的默认设置是每个主机2个连接(在cluster.go
中的NumConns: 2
);而在服务器端,Cassandra将接受最多128个并发请求(在cassandra.yaml
中的native_transport_max_threads: 128
)。谢谢!
英文:
I don't think there is an equivalent of the Cassandra Java driver's setMaxRequestsPerConnection()
in gocql.
The gocql default is 2 connections per host (NumConns: 2
in cluster.go
) and on the server-side, Cassandra will accept up to 128 concurrent requests (native_transport_max_threads: 128
in cassandra.yaml
). Cheers!
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论