Hi All,
I have a question about using CommonsHttpSolrServer with
MultiThreadedHttpConnectionManager. We have a single
CommonsHttpSolrServer instance that handles all the solr requests. Once
we deployed our application to linux servers, we kept getting too many
files opened exception. After did some internet researches, we found
that use CommonsHttpSolrServer instead of SolrServer should the solution
that we are looking for. I was also hoping to get the overhead down. For
some queries that we are running, Actual qtime is 2 to 3 ms, but the the
call SOLRSERVER.query(query, SolrRequest.METHOD.POST) took more than 80
ms if not more. After we updated our application, we didn't see much
improvement on overhead issues. I am wondering if the changes we put in
place is functional at all. Any suggests/advices/tutorials will be
highly appreciated.
Here is the snippet of our codes that does initialization and query. If
we keep the code as it is, is the multithreadconnectionmanager active at
all or we need to call CommonsHttpSolrServer.request() to take
advantages of the connection pooling
HttpClient client = new HttpClient();
MultiThreadedHttpConnectionManager mgr = new
MultiThreadedHttpConnectionManager();
client.setHttpConnectionManager(mgr);
SOLRSERVER = new
CommonsHttpSolrServer(Constants.SOLRSERVERURL, client);
SOLRSERVER.setDefaultMaxConnectionsPerHost(10000);
SOLRSERVER.setMaxTotalConnections(10000);
SOLRSERVER.setMaxRetries(1);
SOLRSERVER.setSoTimeout(1000);
SolrQuery query = new SolrQuery(queryString);
QueryResponse response = SOLRSERVER.query(query,
SolrRequest.METHOD.POST);
Thanks
Chang