From afbc6b0db3d9458ec20f96bc0376cfc1615f7552 Mon Sep 17 00:00:00 2001 From: Arek Mateusiak Date: Thu, 9 Apr 2026 03:24:07 +0200 Subject: [PATCH] perf: enable Gunicorn preload_app to reduce memory per worker (#12364) * fix: enable preload_app option in LangflowApplication configuration * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes * Make flag configurable * [autofix.ci] apply automated fixes * [autofix.ci] apply automated fixes (attempt 2/3) * [autofix.ci] apply automated fixes (attempt 3/3) --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Gabriel Luiz Freitas Almeida Co-authored-by: ogabrielluiz Co-authored-by: Jordan Frazier Co-authored-by: Jordan Frazier <122494242+jordanrfrazier@users.noreply.github.com> --- src/backend/base/langflow/__main__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/backend/base/langflow/__main__.py b/src/backend/base/langflow/__main__.py index 7e2c2d6dd2..eae5f3825e 100644 --- a/src/backend/base/langflow/__main__.py +++ b/src/backend/base/langflow/__main__.py @@ -413,6 +413,7 @@ def run( "certfile": ssl_cert_file_path, "keyfile": ssl_key_file_path, "log_level": log_level.lower() if log_level is not None else "info", + "preload_app": os.environ.get("LANGFLOW_GUNICORN_PRELOAD", "false").lower() == "true", } server = LangflowApplication(app, options)