Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Support dynamically adjusting the number of transaction connection pools and read-only connection pools #17046

Open
ISADBA opened this issue Oct 23, 2024 · 7 comments
Assignees
Labels
Component: Query Serving Component: VTTablet Type: Enhancement Logical improvement (somewhere between a bug and feature)

Comments

@ISADBA
Copy link

ISADBA commented Oct 23, 2024

Feature Description

Support dynamically adjusting the number of transaction connection pools and read-only connection pools
like:
--queryserver-config-pool-size
--queryserver-config-transaction-cap

Use Case(s)

Our Vitess cluster has more than 400 vttablets. The deployment method is based on k8s. We mainly use unmanaged mode and the backend is cloud RDS. When we want to adjust --queryserver-config-pool-size or --queryserver-config-transaction -cap, the pod will be rebuilt, causing business errors.
So we hope to be able to dynamically adjust the number of vttablet-level connection pools through vtctldclient.

Why we need to dynamically adjust the number of connection pools is because the total number of connections in our cloud RDS is limited, so the initial number of connection pools in vitess will not be too high.

@ISADBA ISADBA added the Needs Triage This issue needs to be correctly labelled and triaged label Oct 23, 2024
@deepthi
Copy link
Member

deepthi commented Oct 23, 2024

There is already a way to set these dynamically, and that is through the /debug/env endpoint of vttablet. We can also enable changing them dynamically through a config file. That will be an enhancement.

@deepthi deepthi added Component: VTTablet Type: Enhancement Logical improvement (somewhere between a bug and feature) and removed Needs Triage This issue needs to be correctly labelled and triaged labels Oct 23, 2024
@harshit-gangal
Copy link
Member

There was an attempt to use viper config to allow dynamic loading of some of the config in tabletserver
#14548

@harshit-gangal
Copy link
Member

@ISADBA have you tried the /debug/env to update the pool size?
Warn: This is an in-memory change and not persisted as config change.

@ISADBA
Copy link
Author

ISADBA commented Oct 24, 2024

@harshit-gangal

@ISADBA have you tried the /debug/env to update the pool size? Warn: This is an in-memory change and not persisted as config change.

Thank you for your response.
I will try to update the connection pool using /debug/env.
The method of modification is similar ?
/Users/jojo/Documents/github.com/vitess/go/vt/vttablet/endtoend/config_test.go::changeVar()

@ISADBA
Copy link
Author

ISADBA commented Oct 24, 2024

@harshit-gangal
What is the command for the operation?
curl -X POST http://172.1.0.100:15000/debug/env?format=json -H "Content-Type: application/x-www-form-urlencoded" -d "varname=PoolSize&value=10"

I used this command, but it didn’t work?

more informations:
RowStreamerMaxInnoDBTrxHistLen and QueryCacheCapacity can take effect。

@mattlord
Copy link
Contributor

This is how I've changed other values successfully:

curl -d "Action=Modify&varname=RowStreamerMaxInnoDBTrxHistLen&value=990000000" -X POST localhost:15000/debug/env

@ISADBA
Copy link
Author

ISADBA commented Oct 25, 2024

This is how I've changed other values successfully:

curl -d "Action=Modify&varname=RowStreamerMaxInnoDBTrxHistLen&value=990000000" -X POST localhost:15000/debug/env

@harshit-gangal @mattlord

sad,It’s not work,My vitess version is v16.0.0,this version is not support this feature?

vitess@vitess-cluster-zone1-vtctld-8ba63c48-86b6cd755b-b4xwv:/$ curl -X POST http://172.1.0.100:15000/debug/env?format=json -H "Content-Type: application/x-www-form-urlencoded" -d "Action=Modify&varname=PoolSize&value=10"
{"Consolidator":"enable","MaxResultSize":"100000","PoolSize":"5","QueryCacheCapacity":"33554433","RowStreamerMaxInnoDBTrxHistLen":"999999","RowStreamerMaxMySQLReplLagSecs":"43200","StreamPoolSize":"96","ThrottleMetricThreshold":"1","TxPoolSize":"5","UnhealthyThreshold":"2h0m0s","WarnResultSize":"0"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Query Serving Component: VTTablet Type: Enhancement Logical improvement (somewhere between a bug and feature)
Projects
None yet
Development

No branches or pull requests

4 participants