You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by im...@yahoo.in on 2013/11/26 07:04:09 UTC

HttpSolrServer - Http Client Connection pooling issue

Hi,

Hopefully I am mailing the correct mailid for solr issue. If not then please let me know accordingly.

We are using Solr 4.3.1 and we are using HttpSolrServer for querying Solr.

We are trying to do a load and stress test using Jmeter and we can see that after certain requests Solr responds in very unusual way. It gets stuck and responds only after sometime. Upon checking the Http Connections we realized that there are so many open connections that are not closed.
My questions are:
1. Is there a way to do HTTP connection  pooling ?

Note that HttpSolrServer instance is static.

2. Can I configure Http Connections using solrconfig file ?

Any pointers would be very helpful.

--
Thanks,
Gaurav

Re: HttpSolrServer - Http Client Connection pooling issue

Posted by Shawn Heisey <so...@elyograg.org>.
On 11/25/2013 11:04 PM, imgauravd@yahoo.in wrote:
> We are using Solr 4.3.1 and we are using HttpSolrServer for querying Solr.
> 
> We are trying to do a load and stress test using Jmeter and we can see that after certain requests Solr responds in very unusual way. It gets stuck and responds only after sometime. Upon checking the Http Connections we realized that there are so many open connections that are not closed.
> My questions are:
> 1. Is there a way to do HTTP connection  pooling ?

As of Solr 4.2, SolrJ uses SystemDefaultHttpClient for its HttpClient,
which by default uses PoolingClientConnectionManager.  It should already
be using connection pooling.  Earlier versions (with DefaultHttpClient)
probably used a similar connection manager.

There is a bug in SolrJ related to leaking HttpClient connections.  That
bug is fixed in 4.5.1, so the fix is also in the just-released 4.6.0.

https://issues.apache.org/jira/browse/SOLR-4327

> Note that HttpSolrServer instance is static.
> 
> 2. Can I configure Http Connections using solrconfig file ?

The solrconfig.xml file configures the Solr *server*.  Although some
server settings do affect client connections, most of the configuration
for the client is done in the client.  You can create your own
HttpClient for SolrJ and configure it however you like.

If you are using SolrCloud or distributed search, then there is a SolrJ
client within Solr itself that can be configured with HttpShardHandler
configuration in solrconfig.xml or solr.xml.

Thanks,
Shawn