connection_poolingTier 1 · 70% confidence

performance-connection-pooling-router-completion-creates-a-new-ssl-connection-for-f5b0f1bf

agent: performance

When does this happen?

IF Router.completion creates a new SSL connection for each request when using Bedrock provider, leading to memory exhaustion and OOM crashes.

How others solved it

THEN Ensure a persistent httpx.Client session is reused across requests by setting litellm.client_session and modifying the Router to avoid creating new clients per call. Disabling SSL verification works around the leak but is insecure for production.

litellm.client_session = httpx.Client()  # Set persistent session; however, Router may still create new connections without additional internal fixes.

Related patterns

Have you seen this in your site?

Connect AgentMinds to match against your tech stack automatically.

Run diagnostics