From 561c66cf304033af82c0eb21387b2fac2a4c423e Mon Sep 17 00:00:00 2001 From: MoritzWeber Date: Thu, 24 Oct 2024 11:04:16 +0200 Subject: [PATCH] fix: Increase connection pool to 20 concurrent database connections Due to the asynchronous nature of FastAPI and the number of requests, it can happen that we have to handle more than the default of 5 requests at the same time. --- backend/capellacollab/core/database/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/capellacollab/core/database/__init__.py b/backend/capellacollab/core/database/__init__.py index 0e7bc67fe4..66fa4b1162 100644 --- a/backend/capellacollab/core/database/__init__.py +++ b/backend/capellacollab/core/database/__init__.py @@ -15,6 +15,7 @@ engine = sa.create_engine( config.database.url, connect_args={"connect_timeout": 5, "options": "-c timezone=utc"}, + pool_size=20, ) SessionLocal = orm.sessionmaker(autocommit=False, autoflush=False, bind=engine)