-
Notifications
You must be signed in to change notification settings - Fork 14.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Investigate if we can replace gunicornmontor
with uvicorn.run()
#43035
Comments
The current GunicornMonitor provides the following capabilities:
If we switch to If a worker dies, there's no master process to restart it. |
For 2: https://docs.gunicorn.org/en/stable/signals.html
Doesn't Gunicorn do that itself? https://docs.gunicorn.org/en/stable/design.html#master
So it's only the case of "worker hang" that might not be there anymore.Let me think |
For 1: https://docs.gunicorn.org/en/stable/settings.html#timeout I think? |
Just one comment here -> I've heard (but it's mostly through grapevine) that for quite a long time, uvicorn has the capability (and it's more and more recommended in production) - to manage multiple processes and handle sync requests directly - on their own and there is basically no need to use gunicorn at all. Again it's more of "overheard" thing but looking at https://www.uvicorn.org/deployment/#using-a-process-manager , maybe that's what we are looking for? (or maybe I misunderstood what we want to do, just wanted to mention that gunicorn might not be needed at all maybe) |
gunicornmontor
& replace it with uvicorn.run()
if we don'tgunicornmontor
& replace it with uvicorn.run()
gunicornmontor
& replace it with uvicorn.run()
gunicornmontor
with uvicorn.run()
To perform the comparison. I replaced Gunicorn code in else block with below
I used locust for performance testing with below configuration These are the stats comparing Comparison: Uvicorn vs. Gunicorn PerformanceRequest Statistics
Observations
|
Nice!. |
It is most likely that we no longer need
gunicornmontor
orUvicornMonitor
anymore. @ashb 's suggestion is for Airflowuvicorn.run()
should be enough.Whoever takes this GitHub issue should verify the same and replace it if not needed.
The code:
airflow/airflow/cli/commands/fastapi_api_command.py
Lines 159 to 190 in f38d56d
airflow/airflow/cli/commands/webserver_command.py
Lines 49 to 107 in f38d56d
The text was updated successfully, but these errors were encountered: