Home  >  Article  >  Backend Development  >  How to set max pool size in gocql?

How to set max pool size in gocql?

王林
王林forward
2024-02-12 16:00:07546browse

如何在 gocql 中设置最大池大小?

Question content

I want to know how to explicitly set the maximum pool size in gocql?

What I mean is changing the number of queries running simultaneously.

We see 200ms average response time in Grafana, but we see 24ms average read latency in the Cassansra exporter panel. Is it related to pool size?

PS I think this is a function in the Java driver: poolingOptions.setMaxRequestsPerConnection(num). What is the equivalent function in gocql?

Workaround

I don't think there is an equivalent in gocql to the Cassandra Java driver's setMaxRequestsPerConnection().

gocql defaults to 2 connections per host (NumConns: 2 in cluster.go), on the server side, Cassandra will accept up to 128 Concurrent requests (native_transport_max_threads: 128<code> in cassandra.yaml). cheers!

The above is the detailed content of How to set max pool size in gocql?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
This article is reproduced at:stackoverflow.com. If there is any infringement, please contact admin@php.cn delete