vtgate Connection Pool Limits Across MySQL Users
0 reputation · 23 Mar 2025, 08:28 UTC
vtgate Global Connection Pool Enforcement
In Vitess, vtgate acts as the primary query router distributing traffic across shards through vtctl-managed topology. The connection pooling mechanism in vtgate enforces limits globally across all MySQL users rather than per-user quotas. This behavior stems from the current implementation where -pool_timeout and -query_cache_size parameters apply cluster-wide.
The constraint becomes significant in multi-tenant environments where different MySQL users may have varying service level requirements. While vttablet handles shard state transitions and replication health, vtgate's pooling layer does not distinguish between user contexts when enforcing connection limits.
This creates a scenario where a single high-volume MySQL user could potentially exhaust the entire connection pool, impacting lower-priority users. The current design assumes homogeneous connection patterns across all users.
Questions:
1. Does vtgate provide any mechanism to configure per-user connection rate limiting independent of the global pool settings?
2. How can administrators ensure fair connection distribution when MySQL users have different traffic profiles?
3. Is there a roadmap for implementing user-specific connection quotas in vtgate's connection pooling layer?