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 rahul <as...@gmail.com> on 2011/03/15 14:20:12 UTC
Solrj Performance check.
Hi,
I am using Solrj as a Solr client in my project.
While searching, for a few words, it seems Solrj takes more time to send
response, for eg (8 - 12 sec). While searching most of the other words it
seems Solrj take less amount of time only.
For eg, if I post a search url in browser, it shows the QTime in
milliseconds only.
http://serverName/solr/mydata/select?q=computing&qt=myhandler&fq=category:1
But, if I query the same using Solrj from my project like below, it takes
long time(8 - 12 sec) to produce the same results. Hence, I suspect whether
Solrj takes such long time to produce results.
SolrServer server = new CommonsHttpSolrServer(url);
SolrQuery query = new SolrQuery("computing");
query.setParam("qt", "myhandler");
query.setFilterQueries("category:1");
query.setHighlight(false);
QueryResponse rsp = server.query( query );
I have tried both POTH and GET method. But, both are taking much time.
Any idea why Solrj takes such long time for particular words. It returns
around 40 doc list as a search result. I have even comment out highlighting
for that.
And any way to speed it up.
Note: I am using Tomcat and set heap size as around 1024 mb.
Thanks,
--
View this message in context: http://lucene.472066.n3.nabble.com/Solrj-Performance-check-tp2681444p2681444.html
Sent from the Solr - User mailing list archive at Nabble.com.
Re: Solrj Performance check.
Posted by Chris Hostetter <ho...@fucit.org>.
: For eg, if I post a search url in browser, it shows the QTime in
: milliseconds only.
:
: http://serverName/solr/mydata/select?q=computing&qt=myhandler&fq=category:1
:
: But, if I query the same using Solrj from my project like below, it takes
: long time(8 - 12 sec) to produce the same results. Hence, I suspect whether
: Solrj takes such long time to produce results.
a) QTime is only the time spent processing the request, it doens't include
the time spent writing the results back to hte client (which may be high
if there are a lot of documents in the response, or very large documents
i nthe response, or lots of network overhead, etc...)
b) how are you timing your SolrJ code? the snippet you presented doesn't
give us any indication of what you are using to determine the 8-12 second
timing number, so we have no way of knowing what exactly might be
contributing to the total time.
: SolrServer server = new CommonsHttpSolrServer(url);
: SolrQuery query = new SolrQuery("computing");
: query.setParam("qt", "myhandler");
: query.setFilterQueries("category:1");
: query.setHighlight(false);
: QueryResponse rsp = server.query( query );
(for instance: if you put those lines in a small java program and time the
entire program, that's going ot be a bad way to represent the timing, as
it will also factor in all the time spent initializing hte JVM, loading
classes etc...)
-Hoss