lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Simon Willnauer <simon.willna...@googlemail.com>
Subject Re: questions on CommonsHttpSolrServer and MultiThreadedHttpConnectionManager
Date Sun, 23 May 2010 19:59:00 GMT
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 <Chang.Liu@disney.com> 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: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message