airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Replacing gunicornmontor with uvicorn.run()

Open vatsrahul1001 opened this issue 2 months ago • 0 comments

Related: https://github.com/apache/airflow/issues/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 avatar Dec 20 '24 07:12 vatsrahul1001