Performance: querytime and caching

53 views
Skip to first unread message

Axel Gerke

unread,
Feb 27, 2011, 6:24:08 AM2/27/11
to solrpy
hi there,

I'm using solrpy from pypi in version 0.9.4. Since I've testing it,
I'm wondering about the query-time:

Here's my Code with debug-output:
....
print "Getting query: %s \r" % query
begin = time.time()
response = solr_conn.query(solr_query % query)
print "found %s results in %2f ms! \r" % (len(response.results),
((time.time() - begin) * 1000))
(yes, I know result is only the first batch ;-) )
....

The result:
Getting query: geld (german word for money)
found 13 results in 74.988842 ms!

The logfile from solr says (QTime is the query time in miliseconds):
INFO: [pegasus] webapp=/solr_dev path=/select
params={fl=*,score&q=SearchableText:(geld)&wt=standard&version=2.2}
hits=13 status=0 QTime=26

If I query now two or more times the same word one after another, you
can see in the solr-logfile, that solr's cache is activated (QTime=0
miliseconds) but the solrpy-query-time is still varying:

Python Query result:
Getting query: geld
found 13 results in 9.368896 ms!
Getting query: geld
found 13 results in 79.813957 ms!
Getting query: geld
found 13 results in 49.443960 ms!
Getting query: geld
found 13 results in 59.473038 ms!

The logfile from solr says (QTime is the query time in miliseconds):
27.02.2011 14:14:25 org.apache.solr.core.SolrCore execute
INFO: [pegasus] webapp=/solr_dev path=/select
params={fl=*,score&q=SearchableText:(geld)&wt=standard&version=2.2}
hits=13 status=0 QTime=0
27.02.2011 14:14:39 org.apache.solr.core.SolrCore execute
INFO: [pegasus] webapp=/solr_dev path=/select
params={fl=*,score&q=SearchableText:(geld)&wt=standard&version=2.2}
hits=13 status=0 QTime=0
27.02.2011 14:14:45 org.apache.solr.core.SolrCore execute
INFO: [pegasus] webapp=/solr_dev path=/select
params={fl=*,score&q=SearchableText:(geld)&wt=standard&version=2.2}
hits=13 status=0 QTime=0
27.02.2011 14:14:53 org.apache.solr.core.SolrCore execute
INFO: [pegasus] webapp=/solr_dev path=/select
params={fl=*,score&q=SearchableText:(geld)&wt=standard&version=2.2}
hits=13 status=0 QTime=0

Got any idea, why the querytime is varying at the solrpy query?

Axel Gerke

unread,
Feb 27, 2011, 12:51:33 PM2/27/11
to solrpy
Hi there,

On 27 Feb., 12:24, Axel Gerke <age...@googlemail.com> wrote:
> hi there,
> ....
> Got any idea, why the querytime is varying at the solrpy query?

I've also tried to change the request from POST to GET like in
http://groups.google.com/group/solrpy/browse_thread/thread/d18de024057d4889#
observed. But there's no differenz in the response times.
Reply all
Reply to author
Forward
0 new messages