Skip to content

Conversation

jugalshah291
Copy link
Contributor

@jugalshah291 jugalshah291 commented Jul 8, 2025

Why are these changes needed?

The _get_live_deployments function internally calls get_deployments_in_application that iterates over self._deployment_state ( that stores all the live deployments) and filters out deployment for a specific app. This is inefficient especially when you have a large of serve application running. (For every serve application we are iterating over all the deployments)

Related issue number

Closes #45793

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 :(

@jugalshah291 jugalshah291 marked this pull request as ready for review July 9, 2025 20:49
@jugalshah291 jugalshah291 requested a review from a team as a code owner July 9, 2025 20:49
Copy link
Contributor

@zcin zcin left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@zcin zcin added the go add ONLY when ready to merge, run all tests label Jul 9, 2025
@cszhu cszhu added community-contribution Contributed by the community serve Ray Serve Related Issue labels Jul 10, 2025
Copy link
Contributor

@abrarsheikh abrarsheikh left a comment

Choose a reason for hiding this comment

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

nice :)

@zcin zcin merged commit c10ca31 into ray-project:master Jul 10, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Contributed by the community go add ONLY when ready to merge, run all tests serve Ray Serve Related Issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Serve] Optimize the _get_live_deployments function
4 participants