SolrNet connection errors (IIS->Tomcat) due to only two concurrent connections between servers on same subnet

StackOverflow https://stackoverflow.com/questions/8909328

Question

I have an IIS server which serves a search page using SolrNet. The search index is Solr, running inside Tomcat, on a separate machine on the same subnet (in the same room).

I get intermittent connection errors from IIS to the search server, mainly (InnerException):

Error: The operation has timed out
In: System.Net.WebResponse GetResponse()
Stack Trace: at System.Net.HttpWebRequest.GetResponse()
at HttpWebAdapters.Adapters.HttpWebRequestAdapter.GetResponse()

As well as sometimes (InnerException):

Error: Unable to connect to the remote server
In: System.Net.WebResponse GetResponse()
Stack Trace: at System.Net.HttpWebRequest.GetResponse()

I believe the problem is that IIS only ever has two concurrent connections to Tomcat (which I can see using CurPorts), so eventually the calls get so backed up it times out, but I can't work out why. My preview site, on the same server, is able to create more connections, but increasing the setting using this code in web.config makes no difference:

<connectionManagement>
  <add address="*" maxconnection="100"/>
</connectionManagement>

I have already increased the SolrNet timeout to 30s using:

SolrNet.Startup.Init<SolrDataObject>(new SolrNet.Impl.SolrConnection(System.Configuration.ConfigurationManager.AppSettings["SolrURL"]) { Timeout = 30000 });

I first asked this question about these same errors - I have since found out that there are only ever two connections from IIS to Tomcat, and this seems a very likely cause for this problem to me.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top