-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
[serve] reduce remote calls for get handle APIs #44812
Conversation
This PR makes two changes to the get handle APIs: 1. First, it optimizes `serve.get_app_handle`, which made two separate calls to the controller: one to get the ingress deployment name for the specified application, and one to check if the deployment exists. This is unnecessary and can be squashed into one call; in other words the second call doesn't need to be made. 2. `serve.get_deployment_handle` makes one call to the controller to check if the specified deployment exists. This remains the default behavior, but this PR adds a private flag `_check_exists` which can be set to False if the user wants to bypass that check for performance reasons. Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Thanks for jumping on this so quickly @zcin , hugely appreciated! While we're continuing to debug our performance issues, I think we spotted another place that could set
There's some layers of indirection here, but ultimately this update does come from the Serve Controller directly, if I understood the code correctly, so it probably doesn't need to check for deployment existence again. |
@JoshKarpel Good catch, I believe that is an optimization we can make. I can address this in a separate PR! |
@edoakes Is this ready to merge? |
Awesome, sounds good! |
[serve] reduce remote calls for get handle APIs
This PR makes two changes to the get handle APIs:
serve.get_app_handle
, which made two separate calls to the controller: one to get the ingress deployment name for the specified application, and one to check if the deployment exists. This is unnecessary and can be squashed into one call; in other words the second call doesn't need to be made.serve.get_deployment_handle
makes one call to the controller to check if the specified deployment exists. This remains the default behavior, but this PR adds a private flag_check_exists
which can be set to False if the user wants to bypass that check for performance reasons.Signed-off-by: Cindy Zhang cindyzyx9@gmail.com