Switch from Waitress to Granian (Rust/hyper WSGI server) for improved concurrency

This commit is contained in:
2026-03-14 18:17:39 +08:00
parent 55568d6892
commit d878134ebf
6 changed files with 43 additions and 43 deletions

View File

@@ -107,7 +107,6 @@ def create_app(
)
app.wsgi_app = ProxyFix(app.wsgi_app, x_for=num_proxies, x_proto=num_proxies, x_host=num_proxies, x_prefix=num_proxies)
# Enable gzip compression for responses (10-20x smaller JSON payloads)
if app.config.get("ENABLE_GZIP", True):
app.wsgi_app = GzipMiddleware(app.wsgi_app, compression_level=6)
@@ -678,6 +677,7 @@ def _configure_logging(app: Flask) -> None:
},
)
response.headers["X-Request-Duration-ms"] = f"{duration_ms:.2f}"
response.headers["Server"] = "MyFSIO"
operation_metrics = app.extensions.get("operation_metrics")
if operation_metrics: