This repository was archived by the owner on Mar 24, 2026. It is now read-only.
chore: improve uvicorn settings#9900
Merged
msmith-techempower merged 1 commit intoMay 20, 2025
Merged
Conversation
In this PR we disable the access log and the `ProxyHeaderMiddleware` (https://www.uvicorn.org/deployment/?h=proxyheaders#proxies-and-forwarded-headers). Disable logging is recommended in point 3 of the General Test Requirements (https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#general-test-requirements) and has been done for other python tests like in https://github.com/TechEmpower/FrameworkBenchmarks/pull/9844/files. The ProxyHeadersMiddleware is enabled by default (trusting localhost) and adds considerable latency. As such it should be disabled if not required by test requirements. Enabling these flags increases performance (req/s) by 85% as seen in the numbers below ``` -- Before wrk http://localhost:8000/async Running 10s test @ http://localhost:8000/async 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 268.56us 36.54us 3.49ms 96.57% Req/Sec 18.34k 408.35 18.84k 91.58% 368739 requests in 10.10s, 49.23MB read Requests/sec: 36508.05 Transfer/sec: 4.87MB -- After wrk http://localhost:8000/async Running 10s test @ http://localhost:8000/async 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 143.21us 46.20us 2.00ms 98.02% Req/Sec 33.97k 1.16k 36.29k 82.67% 682461 requests in 10.10s, 91.12MB read Requests/sec: 67570.84 Transfer/sec: 9.02MB ```
msmith-techempower
approved these changes
May 20, 2025
litongjava
pushed a commit
to litongjava/FrameworkBenchmarks
that referenced
this pull request
May 30, 2025
In this PR we disable the access log and the `ProxyHeaderMiddleware` (https://www.uvicorn.org/deployment/?h=proxyheaders#proxies-and-forwarded-headers). Disable logging is recommended in point 3 of the General Test Requirements (https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#general-test-requirements) and has been done for other python tests like in https://github.com/TechEmpower/FrameworkBenchmarks/pull/9844/files. The ProxyHeadersMiddleware is enabled by default (trusting localhost) and adds considerable latency. As such it should be disabled if not required by test requirements. Enabling these flags increases performance (req/s) by 85% as seen in the numbers below ``` -- Before wrk http://localhost:8000/async Running 10s test @ http://localhost:8000/async 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 268.56us 36.54us 3.49ms 96.57% Req/Sec 18.34k 408.35 18.84k 91.58% 368739 requests in 10.10s, 49.23MB read Requests/sec: 36508.05 Transfer/sec: 4.87MB -- After wrk http://localhost:8000/async Running 10s test @ http://localhost:8000/async 2 threads and 10 connections Thread Stats Avg Stdev Max +/- Stdev Latency 143.21us 46.20us 2.00ms 98.02% Req/Sec 33.97k 1.16k 36.29k 82.67% 682461 requests in 10.10s, 91.12MB read Requests/sec: 67570.84 Transfer/sec: 9.02MB ``` Co-authored-by: Sebastian Kreft <911768+sk-@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In this PR we disable the access log and the
ProxyHeaderMiddleware(https://www.uvicorn.org/deployment/?h=proxyheaders#proxies-and-forwarded-headers).Disable logging is recommended in point 3 of the General Test Requirements (https://github.com/TechEmpower/FrameworkBenchmarks/wiki/Project-Information-Framework-Tests-Overview#general-test-requirements) and has been done for other python tests like in https://github.com/TechEmpower/FrameworkBenchmarks/pull/9844/files.
The
ProxyHeadersMiddlewareis enabled by default (trusting localhost) and adds considerable latency. As such it should be disabled if not required by test requirements.Enabling these flags increases performance (req/s) by 85% as seen in the numbers below