8000 [serve] Increase default uvicorn keep alive timeout by akyang-anyscale · Pull Request #54127 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[serve] Increase default uvicorn keep alive timeout #54127

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akyang-anyscale
Copy link
Contributor

Why are these changes needed?

The current default timeout (5 seconds) is shorter than the default idle timeout on common reverse proxies. This can lead to the connection being terminated on the serve side while the revproxy is writing the request to the connection. This PR increases the default timeout to 90 seconds to mitigate this issue.

Related issue number

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

Signed-off-by: akyang-anyscale <alexyang@anyscale.com>
@akyang-anyscale akyang-anyscale requested a review from a team as a code owner June 26, 2025 04:59
@akyang-anyscale akyang-anyscale added the go add ONLY when ready to merge, run all tests label Jun 26, 2025
@@ -20,7 +20,7 @@
DEFAULT_HTTP_PORT = int(os.environ.get("RAY_SERVE_DEFAULT_HTTP_PORT", 8000))

#: Uvicorn timeout_keep_alive Config
DEFAULT_UVICORN_KEEP_ALIVE_TIMEOUT_S = 5
DEFAULT_UVICORN_KEEP_ALIVE_TIMEOUT_S = 90
Copy link
Contributor

Choose a reason for hiding this comment

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

I suggest making this an environment variable, in case if it breaks anything in production, we should be able to easily control it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
go add ONLY when ready to merge, run all tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0