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 Darren Govoni <da...@ontrenet.com> on 2011/10/30 13:25:03 UTC

Query time help

Hi,
   I am running Solr 3.4 in a glassfish domain for itself. I have about 
12,500 documents with a 100 or so fields with the works (stored, 
termv's, etc).

In my webtier code, I use SolrJ and execute a query as such:

             long querystart = new Date().getTime();
             System.out.println("BEFORE QUERY TIME: " + (querystart - 
startime) + " milliseconds.");

1.         QueryResponse qr = solr.query(aquery, METHOD.POST);
             long queryend = new Date().getTime();
             System.out.println("QUERY TIME: " + (queryend - querystart) 
+ " milliseconds. Before QUERY TIME." + (querystart - startime));

The Qtime in the response reads 50-77. But line 1. takes anywhere from 5 
- 13 seconds to complete.

Here is query:
{!lucene q.op=OR df=text_t} ( kind_s:doc OR kind_s:xml) AND (( 
item_sm_t:[* TO *] )) AND (usergroup_sm:admin)

What could be causing this faulty delay?

Server has 15GB RAM. Responses are not unreasonably large. I use paging.

Many thanks,
Darren

Re: Query time help

Posted by Ted Dunning <te...@gmail.com>.
That sounds like Nagle's algorithm.

http://en.wikipedia.org/wiki/Nagle's_algorithm#Interactions_with_real-time_systems

On Sun, Oct 30, 2011 at 2:01 PM, <da...@ontrenet.com> wrote:

> Another interesting note. When I use the Solr Admin screen to perform the
> same query, it doesn't take as long. Only when using SolrJ and Http Solr
> server connection.
>
> >
> >>   I am running Solr 3.4 in a glassfish domain for
> >> itself. I have about 12,500 documents with a 100 or so
> >> fields with the works (stored, termv's, etc).
> >>
> >> In my webtier code, I use SolrJ and execute a query as
> >> such:
> >>
> >>             long querystart =
> >> new Date().getTime();
> >>
> >> System.out.println("BEFORE QUERY TIME: " + (querystart -
> >> startime) + " milliseconds.");
> >>
> >> 1.         QueryResponse qr =
> >> solr.query(aquery, METHOD.POST);
> >>             long queryend =
> >> new Date().getTime();
> >>
> >> System.out.println("QUERY TIME: " + (queryend - querystart)
> >> + " milliseconds. Before QUERY TIME." + (querystart -
> >> startime));
> >>
> >> The Qtime in the response reads 50-77. But line 1. takes
> >> anywhere from 5 - 13 seconds to complete.
> >>
> >> Here is query:
> >> {!lucene q.op=OR df=text_t} ( kind_s:doc OR kind_s:xml) AND
> >> (( item_sm_t:[* TO *] )) AND (usergroup_sm:admin)
> >>
> >> What could be causing this faulty delay?
> >
> > QTime does not include the time that is spend while response travels from
> > solr server to client.
> >
>
>

Re: Query time help

Posted by da...@ontrenet.com.
Another interesting note. When I use the Solr Admin screen to perform the
same query, it doesn't take as long. Only when using SolrJ and Http Solr
server connection.

>
>>   I am running Solr 3.4 in a glassfish domain for
>> itself. I have about 12,500 documents with a 100 or so
>> fields with the works (stored, termv's, etc).
>>
>> In my webtier code, I use SolrJ and execute a query as
>> such:
>>
>>             long querystart =
>> new Date().getTime();
>>            
>> System.out.println("BEFORE QUERY TIME: " + (querystart -
>> startime) + " milliseconds.");
>>
>> 1.         QueryResponse qr =
>> solr.query(aquery, METHOD.POST);
>>             long queryend =
>> new Date().getTime();
>>            
>> System.out.println("QUERY TIME: " + (queryend - querystart)
>> + " milliseconds. Before QUERY TIME." + (querystart -
>> startime));
>>
>> The Qtime in the response reads 50-77. But line 1. takes
>> anywhere from 5 - 13 seconds to complete.
>>
>> Here is query:
>> {!lucene q.op=OR df=text_t} ( kind_s:doc OR kind_s:xml) AND
>> (( item_sm_t:[* TO *] )) AND (usergroup_sm:admin)
>>
>> What could be causing this faulty delay?
>
> QTime does not include the time that is spend while response travels from
> solr server to client.
>


Re: Query time help

Posted by da...@ontrenet.com.
Thanks Erick. I'll check that and report any oddities I find.

> Something you may have overlooked is that with &debugQuery=on,
> way down near the end of the list is a "timing" section, looks like
> this:
> <lst name="timing">
>
> that lists the time each of the components takes to do its thing,
> things like highlighting, morelikethis, even the debug
> component. Sometimes surprises lurk in here, so you might
> want to check that list.
>
> Best
> Erick
>
> On Sun, Oct 30, 2011 at 7:16 PM,  <da...@ontrenet.com> wrote:
>> I have rows=10. Good idea, I will set it to 1.
>>
>> Should I expect a constant return time with rows=10 despite the # of
>> total
>> found documents since they aren't returned?
>>
>>> Another thing to note is that QTime does not include the time it takes
>>> to
>>> retrieve the stored documents to include in the response. So if you're
>>> using a
>>> high rows value in your query, QTime may be much smaller than the
>>> actual
>>> time
>>> Solr spends generating the response.
>>>
>>> Try adding rows=1 to your query and see if it still takes that long.
>>>
>>> -Michael
>>>
>>
>>
>


Re: Query time help

Posted by Erick Erickson <er...@gmail.com>.
Something you may have overlooked is that with &debugQuery=on,
way down near the end of the list is a "timing" section, looks like
this:
<lst name="timing">

that lists the time each of the components takes to do its thing,
things like highlighting, morelikethis, even the debug
component. Sometimes surprises lurk in here, so you might
want to check that list.

Best
Erick

On Sun, Oct 30, 2011 at 7:16 PM,  <da...@ontrenet.com> wrote:
> I have rows=10. Good idea, I will set it to 1.
>
> Should I expect a constant return time with rows=10 despite the # of total
> found documents since they aren't returned?
>
>> Another thing to note is that QTime does not include the time it takes to
>> retrieve the stored documents to include in the response. So if you're
>> using a
>> high rows value in your query, QTime may be much smaller than the actual
>> time
>> Solr spends generating the response.
>>
>> Try adding rows=1 to your query and see if it still takes that long.
>>
>> -Michael
>>
>
>

RE: Query time help

Posted by da...@ontrenet.com.
I have rows=10. Good idea, I will set it to 1.

Should I expect a constant return time with rows=10 despite the # of total
found documents since they aren't returned?

> Another thing to note is that QTime does not include the time it takes to
> retrieve the stored documents to include in the response. So if you're
> using a
> high rows value in your query, QTime may be much smaller than the actual
> time
> Solr spends generating the response.
>
> Try adding rows=1 to your query and see if it still takes that long.
>
> -Michael
>


RE: Query time help

Posted by Michael Ryan <mr...@moreover.com>.
Another thing to note is that QTime does not include the time it takes to
retrieve the stored documents to include in the response. So if you're using a
high rows value in your query, QTime may be much smaller than the actual time
Solr spends generating the response.

Try adding rows=1 to your query and see if it still takes that long.

-Michael

Re: Query time help

Posted by da...@ontrenet.com.
Yeah, I figured that. I guess I will have to dig deeper because the data
transferred is only about 60k and all local on one machine. Shouldn't take
13 seconds for that.

>
>>   I am running Solr 3.4 in a glassfish domain for
>> itself. I have about 12,500 documents with a 100 or so
>> fields with the works (stored, termv's, etc).
>>
>> In my webtier code, I use SolrJ and execute a query as
>> such:
>>
>>             long querystart =
>> new Date().getTime();
>>            
>> System.out.println("BEFORE QUERY TIME: " + (querystart -
>> startime) + " milliseconds.");
>>
>> 1.         QueryResponse qr =
>> solr.query(aquery, METHOD.POST);
>>             long queryend =
>> new Date().getTime();
>>            
>> System.out.println("QUERY TIME: " + (queryend - querystart)
>> + " milliseconds. Before QUERY TIME." + (querystart -
>> startime));
>>
>> The Qtime in the response reads 50-77. But line 1. takes
>> anywhere from 5 - 13 seconds to complete.
>>
>> Here is query:
>> {!lucene q.op=OR df=text_t} ( kind_s:doc OR kind_s:xml) AND
>> (( item_sm_t:[* TO *] )) AND (usergroup_sm:admin)
>>
>> What could be causing this faulty delay?
>
> QTime does not include the time that is spend while response travels from
> solr server to client.
>


Re: Query time help

Posted by Ahmet Arslan <io...@yahoo.com>.
>   I am running Solr 3.4 in a glassfish domain for
> itself. I have about 12,500 documents with a 100 or so
> fields with the works (stored, termv's, etc).
> 
> In my webtier code, I use SolrJ and execute a query as
> such:
> 
>             long querystart =
> new Date().getTime();
>            
> System.out.println("BEFORE QUERY TIME: " + (querystart -
> startime) + " milliseconds.");
> 
> 1.         QueryResponse qr =
> solr.query(aquery, METHOD.POST);
>             long queryend =
> new Date().getTime();
>            
> System.out.println("QUERY TIME: " + (queryend - querystart)
> + " milliseconds. Before QUERY TIME." + (querystart -
> startime));
> 
> The Qtime in the response reads 50-77. But line 1. takes
> anywhere from 5 - 13 seconds to complete.
> 
> Here is query:
> {!lucene q.op=OR df=text_t} ( kind_s:doc OR kind_s:xml) AND
> (( item_sm_t:[* TO *] )) AND (usergroup_sm:admin)
> 
> What could be causing this faulty delay?

QTime does not include the time that is spend while response travels from solr server to client.