-
Notifications
You must be signed in to change notification settings - Fork 65
Closed
Description
Hey there,
It looks like msrest
(as used by the Azure SDK for Python) does not automatically share a requests
context between requests.
I see traces of some code that would allow passing in a requests
Session (e.g. here and maybe here too?), but I have no idea how to use those... I'm just creating a ComputeManagementClient
:)
The reason why this came up is that I profiled a script that basically just does cmc.virtual_machines.list()
about 7 times and it spends half of what it does (29.6 + 17.3 = 46.9%) just connecting to places it could have already have a connection to 😞
Function | Calls | Own Time | % |
---|---|---|---|
_ssl._SSLSocket.read | 20 | 2156 | 39.3% |
_ssl._SSLSocket.do_handshake | 11 | 1626 | 29.6% |
_socket.socket.connect | 11 | 949 | 17.3% |
_ssl._SSLContext.load_verify_locations | 11 | 84 | 1.5% |
So... how do I get my ComputeManagementClient
to keep that requests session, or better yet, how do I get all of my Client objects to share one session (if that's safe)?
Metadata
Metadata
Assignees
Labels
No labels