-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
{ACR} Add connection pooling with ACR registries. #30520
base: dev
Are you sure you want to change the base?
Conversation
❌AzureCLI-FullTest
|
️✔️AzureCLI-BreakingChangeTest
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
|
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
Please rerun some related tests in live mode to verify this change. |
Please note Azure CLI will freeze the code on 01/28/2025 10:00 UTC for the upcoming release. If you want to catch this release train, please get this PR ready ASAP, otherwise it has to be postponed to next sprint. |
@microsoft-github-policy-service agree |
@yanzhudd i didn't realize there are tests available to me. I made sure to run them locally and it should all be good now. |
/azp run |
Azure Pipelines successfully started running 3 pipeline(s). |
please fix the CI issues |
@yanzhudd pipelines run tests without my patches and I can't fix them otherwise, I think. Tests mock |
@johnsonshi This is performance related. Can you please take a look at it? |
/azp run |
@m5i-work, can you take a look at this PR as it relates to a perf improvement using connection pooling when connecting to ACR using cli? |
@@ -34,6 +35,7 @@ | |||
|
|||
|
|||
logger = get_logger(__name__) | |||
session = Session() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of a global var, can we move this to parameters of request_data_from_registry()
? The new parameter can default to None. We can make this PR scoped to repository listing and revisit other call sites of request_data_from_registry()
that can benefit from connection pooling later.
@oxpa Thanks for looking into this! |
Related command
az acr repository list
Description
I have a registry of 60000 (sixty thousands) images. Listing them usually takes ~10 minutes on my internet connection. Largely because listing happens in pages by 100 entries per page. So az cli does ~600 requests to list all images. Each request uses it's own connection.
With this change a request to the same registry will reuse an existing connection (if any) or open a new one.
Connection pooling cuts time from 10+ minutes for listing to under a minute (for my specific case). So at least 60 times better.
It should not break things as I make no initial configuration for a session so no parameters are reused. But I'm happy to fix my code if this naïve approach doesn't work.
Testing Guide
az acr repository list --debug --name some_very_large_repository
Before the patch, every request to a registry would produce a message like this:
With the patch the message goes away, only the first request creates a connection.
The message still there for authentication and other requests.
This checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.