Skip to content

CosmosCLient sample with connection pooling #17165

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

Closed
prashanthmadi opened this issue Mar 8, 2021 · 6 comments
Closed

CosmosCLient sample with connection pooling #17165

prashanthmadi opened this issue Mar 8, 2021 · 6 comments
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos question The issue doesn't require a change to the product in order to be resolved. Most issues start as that

Comments

@prashanthmadi
Copy link

Is your feature request related to a problem? Please describe.
Looking for a cosmosdb sample to utilize connection pools
couldn't find any at https://github.com/Azure/azure-sdk-for-python/tree/master/sdk/cosmos/azure-cosmos/samples

@ghost ghost added the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 8, 2021
@ghost
Copy link

ghost commented Mar 8, 2021

Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @southpolesteve, @zfoster

@yunhaoling yunhaoling added Client This issue points to a problem in the data-plane of the library. Cosmos question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Mar 8, 2021
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Mar 8, 2021
@southpolesteve
Copy link
Contributor

@annatisch Can someone familiar with core-http answer this question? Cosmos doesn't expose any knobs on HTTP connection pools AFAIK. We just use whatever defaults core-http provides.

@annatisch
Copy link
Member

Hi @prashanthmadi, @southpolesteve - sorry I somehow missed this. Let me take a look today.

@annatisch
Copy link
Member

Hi @prashanthmadi - you should be able to supply your own underlying Requests session to the client in order to handle connection pooling - as is documented in this issue here:
#12102 (comment)

Let me know how this goes :)
You're right in that we don't have a sample for this - but given that it is a feature universal to our (recent) SDKs, we would likely document/sample this feature in a common way, rather than write a specific sample for it for every SDK that supports it.

@graemefoster
Copy link

I noticed the Java and .net CosmosClient suggest using CosmosClient as a singleton to improve performance. Is the python CosmosClient threadsafe or is that what supplying a Requests session would allow (apologies I’m new to python).

My situation is I’m using the python CosmosClient in azure functions. I’m creating a new CosmosClient in each request and seeing metadata fetches for every invocation which is impacting performance.

@gahl-levy
Copy link
Contributor

Closing due to inactivity. Please reopen if this is still an issue.

@github-actions github-actions bot locked and limited conversation to collaborators Apr 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. Cosmos question The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Projects
None yet
Development

No branches or pull requests

6 participants