Issues with --limit-concurrency: Immediate Rejection and Inconsistent Behavior on Request Handling #2632
Unanswered
sharathkumar63
asked this question in
Potential Issue
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team,
I'm experiencing unexpected behavior with the --limit-concurrency option in Uvicorn and would like clarification or guidance on whether this is expected or a bug.
🔸 Setup:
Uvicorn run with: --workers 1 --limit-concurrency 1
Requests sent directly to Uvicorn
Issue 1: Immediate 503 Rejection on First Request
When I set --limit-concurrency=1, I expected Uvicorn to process one request at a time and queue or delay others.
However, the very first request itself gets immediately rejected with a 503 Service Unavailable, which shouldn't happen since the concurrency limit has not been breached yet.
Issue 2: Request Rejected After Previous Request Completes
With --limit-concurrency=2, the first request is processed as expected, but subsequent requests get rejected only after the first request finishes.
This behavior feels inconsistent: if the concurrency limit is already exceeded, the request should be rejected immediately—not after the previous one completes.
🔹 Expectation:
Requests beyond the concurrency limit should be either:
Immediately rejected (503)
Rejections should not happen after request completion; that feels like wasted wait time.
❓ Question:
Is this the expected behavior of --limit-concurrency?
I'm encountering multiple issues with this and would appreciate any insights or suggestions.
Thanks in advance!
Beta Was this translation helpful? Give feedback.
All reactions