From 4a059be4803dac764a532919f48bf035a186bb4e Mon Sep 17 00:00:00 2001 From: Bine Date: Fri, 17 Oct 2025 22:17:10 +0200 Subject: [PATCH 1/2] Increase DB engine pool size and max overflow As described in #2568 when multiple clients connect simultaneously, an excessive number of database pool connections are created. This leads to resource exhaustion and connection management issues. We have introduced the pool_size and max_overflow parameters to better control the database connection pool. These parameters ensure the database can handle a sufficient number of concurrent connections without over-allocating resources. Added pool_size and max_overflow arguments to the database initialization. This change overrides the default initialization configuration where the temporary fix was applied. Co-Authored-By: Ufi <86113085+ufiking@users.noreply.github.com> --- gns3server/db/tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gns3server/db/tasks.py b/gns3server/db/tasks.py index 6e147dcee..bfb7dac48 100644 --- a/gns3server/db/tasks.py +++ b/gns3server/db/tasks.py @@ -78,7 +78,7 @@ async def connect_to_db(app: FastAPI) -> None: db_path = os.path.join(Config.instance().config_dir, "gns3_controller.db") db_url = os.environ.get("GNS3_DATABASE_URI", f"sqlite+aiosqlite:///{db_path}") - engine = create_async_engine(db_url, connect_args={"check_same_thread": False, "timeout": 20}, future=True) + engine = create_async_engine(db_url, connect_args={"check_same_thread": False, "timeout": 20}, future=True, pool_size=512, max_overflow=1024) alembic_cfg = config.Config() alembic_cfg.set_main_option("script_location", "gns3server:db_migrations") #alembic_cfg.set_main_option('sqlalchemy.url', db_url) From e817228280d0ae312206e431642b0d4631815177 Mon Sep 17 00:00:00 2001 From: Bine Date: Sat, 18 Oct 2025 18:10:24 +0200 Subject: [PATCH 2/2] Fix non-ASCII characters in project names --- gns3server/api/routes/controller/projects.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/gns3server/api/routes/controller/projects.py b/gns3server/api/routes/controller/projects.py index caa2d3879..cea7c91f3 100644 --- a/gns3server/api/routes/controller/projects.py +++ b/gns3server/api/routes/controller/projects.py @@ -380,7 +380,13 @@ async def export_project( except (ValueError, OSError, RuntimeError) as e: raise ConnectionError(f"Cannot export project: {e}") - headers = {"CONTENT-DISPOSITION": f'attachment; filename="{project.name}.gns3project"'} + fallback = project.name.encode("ascii", "ignore").decode() or "project" + encoded = urllib.parse.quote(project.name, safe="") + headers = { + "Content-Disposition": ( + f'attachment; filename="{fallback}.gns3project"; filename*=UTF-8\'\'{encoded}.gns3project' + ) + } return StreamingResponse(streamer(), media_type="application/gns3project", headers=headers)