jason810496 commented on code in PR #61494: URL: https://github.com/apache/airflow/pull/61494#discussion_r2776709898
########## airflow-core/docs/administration-and-deployment/web-stack.rst: ########## @@ -138,3 +138,36 @@ Use the default uvicorn when: - Running on Windows - Running in development or testing environments - Running short-lived containers (e.g., Kubernetes pods that get recycled) + +.. _running-uvicorn-on-kubernetes: + +Running Uvicorn on Kubernetes +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +When running the API server with ``server_type = uvicorn`` on Kubernetes, +the API server runs as a single long-lived process per pod and does not +support rolling worker restarts like ``gunicorn``. + +In long-running Kubernetes deployments, this may lead to gradual memory +growth or stale internal state over time. For this reason, it is recommended +to periodically restart API server pods when using uvicorn. + +Recommended approaches include: + +- **Kubernetes rolling restarts** of the API server Deployment to recycle pods + without downtime. +- ``Helm-based restarts``, such as triggering a ``rollout`` during a Helm upgrade + or by changing a restart annotation. +- **Cluster-level mechanisms** (for example, scheduled restarts) when running + uvicorn for extended periods. Review Comment: We could even mention #61432 here, but it's fine to merge it right now. I will tracking in #61432 to update this part. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
