2

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?

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
Mojtaba Arezoomand
  • 2,140
  • 8
  • 23

1 Answers1

2

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!

Erick Ramirez
  • 13,964
  • 1
  • 18
  • 23
  • NumConns is actually the number connection to db. The requests will be sent through these connections simultaneously. So I think increasing the number of connections would do the job, thanks. – Mojtaba Arezoomand Feb 27 '23 at 07:21