IBM Cloud Functions and Db2 on Cloud: Tuning Connection Pool Size for Concurrent Invocations
27.5K reputation · 09 Mar 2023, 05:26 UTC
Integration Goal
Determine the appropriate Db2 on Cloud connection pool size that aligns with IBM Cloud Functions maxConcurrent setting to eliminate latency spikes observed only under concurrent invocations.
Constraints and Uncertainty
IBM Cloud Functions controls the number of concurrent activations per container via maxConcurrent; raising this reduces cold‑start latency but can exhaust the Db2 connection pool if its maxConnections is not increased accordingly. The pre‑warmed container option (Enterprise plan) mitigates cold‑starts but does not remove Db2‑related wait times. Observed latency increases when Function concurrency exceeds the Db2 pool size, manifesting as DSN0050I connection‑wait messages. The exact ratio of Functions maxConcurrent to Db2 maxConnections that yields minimal latency under varying workloads remains undetermined, and it is unclear whether connection timeout adjustments or pool resizing strategies should differ for burst versus steady traffic.
Specific questions to resolve:
- What ratio of Db2 maxConnections to Functions maxConcurrent minimizes latency for typical workloads?
- Does enabling the Functions pre‑warmed feature change the required Db2 pool size?
- How should connection timeout and retry settings be tuned to avoid queuing delays during burst traffic?