Happy new year and thank you for taking the time to reply over the holidays.
Today I have done some more extensive testing with logging when a cluster is opened and closed. I can confirm that the cluster is only opened once, but we are receiving the following error at approximately 50 consecutive requests. Note it takes around 40 seconds before it starts to fail.
Only one usage of each socket address (protocol/network address/port) is normally permitted
The cluster is closing when the application pool is stopped or website is stopped as expected. Can we therefore assume that our issue is not with connecting to the cluster, but the bucket and maybe we’re not recycling the buckets faster. Our config entry as as below, is the lifespan anything to be concerned about?
[couchbase useSsl=“false” operationLifespan=“1000”]
[add uri=“http://omitted:8091/pools/default” /]
[add name=“default” useSsl=“false” password=“omitted” operationLifespan=“2000”]
[connectionPool name=“custom” maxSize=“500” minSize=“5” sendTimeout=“12000” /]
Apologies for the formatting it doesn’t accept brackets.
Thanks in advance for your help, it has been invaluable thus far.
To confirm the following method is throwing the exception above:
My code is using:
var cluster = ClusterHelper.Get();
IBucket bucket = cluster.OpenBucket();
Changed the code to:
IBucket bucket = ClusterHelper.GetBucket(“default”);
And it is working much, much better than before. So far no errors I fired off 1250 requests and it took 28 seconds to come back all valid. I’m just running a test that fires a request every few seconds for a couple of hours to see how we go but looks like we’re all good now! I think my understanding of the OpenBucket method was wrong, I thought it was implemented like the GetBucket, so opening and closing a bucket each time per method was not correct.