How do I set the maximum pool size in gocql?

huangapple go评论98阅读模式
英文:

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!

huangapple
  • 本文由 发表于 2023年2月26日 01:11:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/75567084.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定