-
Notifications
You must be signed in to change notification settings - Fork 494
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
GatewayStoreClient buffers entire response body and makes another copy of it for later use #1828
Comments
I agree that it is an issue, but we mainly optimize for Direct mode as it is the recommend mode for performance scenarios. Is there a reason you are using gateway mode? |
We run on Kubernetes and have limited number of connections for containers. With large number of pods on each node and Azure limits per node we quickly run out of connections. We tried Direct mode and had to revert back to gateway mode. Also using Gateway mode provides better insights/logs for HTTP calls out of the box. |
Question: Have you tried the reducing the connections with PortReuseMode and IdleConnectionTimeout? That would reduce connections when you have sporadic usage. |
Closing due to in-activity, pease feel free to re-open. |
Describe the bug
GatewayStoreClient buffers entire response body and makes another copy of it for later use. With large number of docs in the response, this doesn't scale well on a busy server.
To Reproduce
Expected behavior
Cosmos client should use streaming and never buffer entire response in memory.
Cosmos client should always use HttpCompletionOption.ResponseHeadersRead for all HTTP calls.
Actual behavior
Environment summary
Linux, NET Core 3.1
Additional context
https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/GatewayStoreClient.cs
Line 369
https://github.com/Azure/azure-cosmos-dotnet-v3/blob/master/Microsoft.Azure.Cosmos/src/HttpClient/CosmosHttpClientCore.cs
Line 201
The text was updated successfully, but these errors were encountered: