while connecting to cosmos DB from an API, I am creating a cosmosclient with with following code. var client = new CosmosClient(endPoint, accountKey, new CosmosClientOptions { IdleTcpConnectionTimeout = new TimeSpan(0, 0, 10, 0), PortReuseMode = PortReuseMode.PrivatePortPool });
This api is working fine. but needed to do load test. IN my load testing using task.parallel I am trying to call that API.
When i am doing load test by sending request to the api . At that time I am getting socket error with description . "Only one usage of each socket address (protocol/network address/port) is normally permitted"
I tried to change the cosmosclientOptions but still it is throwing the same exception. I am sending 700 requests. out of it we are getting 6 to 8 socket errors. api is deployed in azure. Any help is much appreciated.