Skip to content
5 changes: 4 additions & 1 deletion src/vllm_router/aiohttp_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ def start(self):
"""Instantiate the client. Call from the FastAPI startup hook."""
# To fully leverage the router's concurrency capabilities,
# we set the maximum number of connections to be unlimited.
self.async_client = aiohttp.ClientSession()
connector = aiohttp.TCPConnector(limit=0)
self.async_client = aiohttp.ClientSession(
connector=connector, connector_owner=True
)
logger.info(f"aiohttp ClientSession instantiated. Id {id(self.async_client)}")

async def stop(self):
Expand Down