Hey there, check out Ryans link for explanation of your TooManyOpenFiles problem. For the query time, make sure the Nagle alg is disabled - should be by default though.
MultiThreadedHttpConnectionManager mgr = new MultiThreadedHttpConnectionManager(); mgr.getParams().setTcpNoDelay(true) You should also make sure you keep your HttpClient instance around and share it between requests that will most likely improve your performance. Don't know if you do it but I can not tell from the snippet you send around. I also think your default values for setDefaultMaxConnectionsPerHost and setMaxTotalConnections is kind of high. I guess you can reduce them dramatically to about 100 or 1000 simon On Sat, May 22, 2010 at 2:05 AM, Liu, Chang <[email protected]> wrote: > 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 > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
