we have 5 shards and each shard with one leader and one replica.
the "3300" connections is only for one JVM. please see the follow analysis
in zabbix.


​

​

and we the solrj code as follow:

    public synchronized static CloudSolrServer getSolrCloudReadServer() {
        if (reviewSolrCloudReadServer == null) {
            ModifiableSolrParams params = new ModifiableSolrParams();
            params.set(HttpClientUtil.PROP_MAX_CONNECTIONS, 1000);
            params.set(HttpClientUtil.PROP_MAX_CONNECTIONS_PER_HOST, 100);
            HttpClient client = HttpClientUtil.createClient(params);

            LBHttpSolrServer lbServer = new LBHttpSolrServer(client);

lbServer.setConnectionTimeout(ReviewProperties.getCloudConnectionTimeOut());
            lbServer.setSoTimeout(ReviewProperties.getCloudSoTimeOut());
            reviewSolrCloudReadServer = new
CloudSolrServer(ReviewProperties.getZkHost(),lbServer);

reviewSolrCloudReadServer.setDefaultCollection(ReviewProperties.getZkReviewConnection());

reviewSolrCloudReadServer.setZkClientTimeout(ReviewProperties.getZkClientTimeout());

reviewSolrCloudReadServer.setZkConnectTimeout(ReviewProperties.getZkConnectTimeout());
        }
        return reviewSolrCloudReadServer;
    }

2016-07-13 8:13 GMT+08:00 Shawn Heisey <apa...@elyograg.org>:

> On 7/12/2016 8:30 AM, Kent Mu wrote:
> > We have configed the maxThreads in JBOSS, and the good news is solrcloud
> > now running OK. but I another issue came across. We find the number of
> the
> > HTTP connections is very high, and the number can be around 3300. and
> > solrcloud does no release the connections.
> > I understand that, the solrcloud needs to connect to zookeeper and
> > communication between leader and replica need the connection. but I think
> > the number should not to be so huge.
> > besides, we use the singleton pattern to connect solrcloud in JAVA.
>
> Are you referring to the number of http connections in your SolrJ app,
> or the number of http connections in Solr itself?  Hopefully these are
> being run by completely separate JVMs.  Where exactly are you looking
> when you see 3300 connections?
>
> The connection to Zookeeper does not use HTTP.  It is a TCP connection
> but the protocol is custom.  Both Solr and SolrJ will maintain a
> connection to each of the zookeeper hosts that are in the zkHost string
> used when they start.
>
> Thanks,
> Shawn
>
>

Reply via email to