distsql: dynamically adjust the number of distsql runners #84459
Labels
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-sql-queries
SQL Queries Team
Currently, we spin up 16 DistSQL runner goroutines whose job is to perform the SetupFlow gRPC call when setting up the distributed query plan. If that pool of 16 workers is used up, then the main goroutine of the query on the gateway sequentially performs those gRPC calls which will add to the query execution latency. I think it'd be worthwhile to introduce an ability to dynamically adjust this pool based on a cluster setting. Probably it'd be good to make the initial value also dependent on the number of CPUs on the node.
My current thinking is that we'd probably want to introduce a coordinator goroutine that would be notified whenever there is a change to the cluster setting. This coordinator would then cancel some workers when shrinking and spin up some new ones when growing the workers pool.
Jira issue: CRDB-17670
The text was updated successfully, but these errors were encountered: