Skip to content
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

Replacing gunicornmontor with uvicorn.run() #45103

Merged

Conversation

vatsrahul1001
Copy link
Collaborator

Related: #43035

These are the stats comparing uvicorn.run() with Gunicorn + GunicornMonitor


Comparison: Uvicorn vs. Gunicorn Performance

Request Statistics

Metric Uvicorn Gunicorn
Total Requests 14,714 14,726
Total Failures 0 13
Average Response Time 12.05 ms 13.46 ms
Min Response Time 7 ms 1 ms
Max Response Time 195 ms 216 ms
Average Size (bytes) 4,608 4,603.93
Requests Per Second (RPS) 49.05 49.09
Failures Per Second 0 0.04

Observations

  1. Response Times:

    • Uvicorn demonstrates slightly lower average and maximum response times compared to Gunicorn.
    • Percentile analysis shows Uvicorn's response times are more consistent, with fewer extreme values at higher percentiles.
  2. Failures:

    • Uvicorn had no failures, whereas Gunicorn recorded 13 failures caused by RemoteDisconnected errors. This could indicate potential issues in connection handling under load.
  3. Performance Consistency:

    • Uvicorn offers better consistency and reliability based on the above data.


^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in newsfragments.

@vatsrahul1001 vatsrahul1001 marked this pull request as draft December 20, 2024 08:27
@vatsrahul1001 vatsrahul1001 force-pushed the replace-gunicorn-with-uvicorn-run branch from 1a74394 to 85305fc Compare December 31, 2024 06:19
@vatsrahul1001 vatsrahul1001 marked this pull request as ready for review December 31, 2024 07:01
@kaxil kaxil requested review from ashb and jscheffl January 6, 2025 13:56
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All for it. 👍

Thanks for the metrics that encourage that this is the good choice.

Just a small question.

@apache apache deleted a comment Jan 21, 2025
@apache apache deleted a comment Jan 21, 2025
@apache apache deleted a comment Jan 21, 2025
@apache apache deleted a comment Jan 21, 2025
@apache apache deleted a comment Jan 21, 2025
Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, looks good.

Leaving some time for others to participate in the discussion.

Copy link
Member

@pierrejeambrun pierrejeambrun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CI need fixing, most likely CLI tests need to be updated.

@vatsrahul1001
Copy link
Collaborator Author

CI need fixing, most likely CLI tests need to be updated.

Fixed tests after updating setproctitle

@pierrejeambrun
Copy link
Member

Ok, I think we left enough time for people to participated in case they feel that some other options are necessary. We can always improve later, merging.

@pierrejeambrun pierrejeambrun merged commit 933b003 into apache:main Jan 24, 2025
45 checks passed
@pierrejeambrun pierrejeambrun deleted the replace-gunicorn-with-uvicorn-run branch January 24, 2025 09:03
@utkarsharma2 utkarsharma2 added the type:improvement Changelog: Improvements label Jan 27, 2025
@utkarsharma2 utkarsharma2 added this to the Airflow 3.0.0 milestone Jan 27, 2025
gpathak128 pushed a commit to gpathak128/airflow that referenced this pull request Jan 29, 2025
* replace gunicorm with uvicorn.run()

* fixing tests

* Daemonized fastapi server

* fixing setproctitle format

* updating setproctitle
got686-yandex pushed a commit to got686-yandex/airflow that referenced this pull request Jan 30, 2025
* replace gunicorm with uvicorn.run()

* fixing tests

* Daemonized fastapi server

* fixing setproctitle format

* updating setproctitle
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:CLI type:improvement Changelog: Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants