diff --git a/src/vllm_router/aiohttp_client.py b/src/vllm_router/aiohttp_client.py index 08b73e8e0..bff3c1200 100644 --- a/src/vllm_router/aiohttp_client.py +++ b/src/vllm_router/aiohttp_client.py @@ -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):