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

How to set max pool size in gocql?

王林
Release: 2024-02-12 16:00:07
forward
599 people have browsed it

如何在 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!

Related labels:
source:stackoverflow.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template