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 "Jonnakuti, Vijayalatha" <Vi...@disney.com> on 2014/10/06 17:28:27 UTC

Does CloudSolrServer hit zookeeper for every request?

Hi
We have too many zookeeper connections and had to increase max client connection on zookeeper(3.4.6)

The underlaying problem looks like,
CloudSolrServer makes a connect call to zookeeper for every request  but never disconnects.
 Am I supposed to call getZkStateReader().close() for every request? Or am I missing something?

Solr Configuration is

<autoCommit>
  <maxDocs>10000</maxDocs>
  <maxTime>900000</maxTime>
  <openSearcher>false</openSearcher>
</autoCommit>
<commitWithin>
  <softCommit>true</softCommit>
</commitWithin>
<autoSoftCommit>
       <maxTime>10000</maxTime>
</autoSoftCommit>

Thanks.,
Vijaya

Re: Does CloudSolrServer hit zookeeper for every request?

Posted by Shalin Shekhar Mangar <sh...@gmail.com>.
CloudSolrServer doesn't hit ZooKeeper for every request. I am guessing that
you are creating a new CloudSolrServer object per request. Don't do that.
Create just one CloudSolrServer and re-use it for all requests. It is a
thread-safe object.

On Mon, Oct 6, 2014 at 8:58 PM, Jonnakuti, Vijayalatha <
Vijayalatha.Jonnakuti@disney.com> wrote:

> Hi
> We have too many zookeeper connections and had to increase max client
> connection on zookeeper(3.4.6)
>
> The underlaying problem looks like,
> CloudSolrServer makes a connect call to zookeeper for every request  but
> never disconnects.
>  Am I supposed to call getZkStateReader().close() for every request? Or am
> I missing something?
>
> Solr Configuration is
>
> <autoCommit>
>   <maxDocs>10000</maxDocs>
>   <maxTime>900000</maxTime>
>   <openSearcher>false</openSearcher>
> </autoCommit>
> <commitWithin>
>   <softCommit>true</softCommit>
> </commitWithin>
> <autoSoftCommit>
>        <maxTime>10000</maxTime>
> </autoSoftCommit>
>
> Thanks.,
> Vijaya
>



-- 
Regards,
Shalin Shekhar Mangar.

Re: Does CloudSolrServer hit zookeeper for every request?

Posted by Shawn Heisey <ap...@elyograg.org>.
On 10/6/2014 12:15 PM, amitha wrote:
> Yeah I saw that does if I call shutdown after a request and need to make
> another request I get 
> org.apache.solr.client.solrj.SolrServerException:
> java.lang.IllegalStateException: Connection pool shut down

You would only call shutdown if you're done with the server object and
don't plan to use it again.  That method shuts the object down so it
can't be used any more.

I admit that I don't have a lot of experience with CloudSolrServer, and
I haven't looked at the code in enough detail to know exactly how it
works ... but I had always thought that the zookeeper client would
maintain a constant connection with every ZK server that you tellit about.

You haven't put a load balancer in front of your zookeeper servers, have
you?  That's completely unnecessary - just inform CloudSolrServer about
all three of them.

I thought we got some much better javadocs into a recent release, but it
looks like it's only in the new stable branch and trunk.

Here's the new CloudSolrServer(String) javadoc comment that will be in 5.0:

http://apaste.info/BVu

Thanks,
Shawn


Re: Does CloudSolrServer hit zookeeper for every request?

Posted by amitha <am...@yahoo.com>.
Yeah I saw that does if I call shutdown after a request and need to make
another request I get 
org.apache.solr.client.solrj.SolrServerException:
java.lang.IllegalStateException: Connection pool shut down




--
View this message in context: http://lucene.472066.n3.nabble.com/Does-CloudSolrServer-hit-zookeeper-for-every-request-tp4139413p4162969.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Does CloudSolrServer hit zookeeper for every request?

Posted by Joel Bernstein <jo...@gmail.com>.
There is a shutdown() method on CloudSolrServer that releases the resources
for CloudSolrServer.

Joel Bernstein
Search Engineer at Heliosearch

On Mon, Oct 6, 2014 at 11:39 AM, Jonnakuti, Vijayalatha <
Vijayalatha.Jonnakuti@disney.com> wrote:

> We are using solr 4.8.0
>
> From: <Jonnakuti>, Vijay Jonnakuti <vijayalatha.jonnakuti@disney.com
> <ma...@disney.com>>
> Date: Monday, October 6, 2014 at 8:34 AM
> To: "solr-user@lucene.apache.org<ma...@lucene.apache.org>" <
> solr-user@lucene.apache.org<ma...@lucene.apache.org>>
> Subject: Does CloudSolrServer hit zookeeper for every request?
>
> Hi
> We have too many zookeeper connections and had to increase max client
> connection on zookeeper(3.4.6)
>
> The underlaying problem looks like,
> CloudSolrServer makes a connect call to zookeeper for every request  but
> never disconnects.
>  Am I supposed to call getZkStateReader().close() for every request? Or am
> I missing something?
>
> Solr Configuration is
>
> <autoCommit>
>   <maxDocs>10000</maxDocs>
>   <maxTime>900000</maxTime>
>   <openSearcher>false</openSearcher>
> </autoCommit>
> <commitWithin>
>   <softCommit>true</softCommit>
> </commitWithin>
> <autoSoftCommit>
>        <maxTime>10000</maxTime>
> </autoSoftCommit>
>
> Thanks.,
> Vijaya
>

Re: Does CloudSolrServer hit zookeeper for every request?

Posted by "Jonnakuti, Vijayalatha" <Vi...@disney.com>.
We are using solr 4.8.0

From: <Jonnakuti>, Vijay Jonnakuti <vi...@disney.com>>
Date: Monday, October 6, 2014 at 8:34 AM
To: "solr-user@lucene.apache.org<ma...@lucene.apache.org>" <so...@lucene.apache.org>>
Subject: Does CloudSolrServer hit zookeeper for every request?

Hi
We have too many zookeeper connections and had to increase max client connection on zookeeper(3.4.6)

The underlaying problem looks like,
CloudSolrServer makes a connect call to zookeeper for every request  but never disconnects.
 Am I supposed to call getZkStateReader().close() for every request? Or am I missing something?

Solr Configuration is

<autoCommit>
  <maxDocs>10000</maxDocs>
  <maxTime>900000</maxTime>
  <openSearcher>false</openSearcher>
</autoCommit>
<commitWithin>
  <softCommit>true</softCommit>
</commitWithin>
<autoSoftCommit>
       <maxTime>10000</maxTime>
</autoSoftCommit>

Thanks.,
Vijaya