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 李银松 <le...@gmail.com> on 2008/04/09 04:13:54 UTC
How to improve Solr search performance
I'm testing solr search performance using LoadRunner
the index contains 5M+ docs , about 10.7GB large.
CPU:3.2GHz*2 RAM16GB
The result si dispirited
max:19s min 1.5s avg 11.7s
But the QTime is around 1s
(simple query without facet or mlt,just fetch the top 50 IDs)
So it seems that XMLWriter is the bottleneck
Am I right? Or is there anything i can do to improve the performance?
Re: How to improve Solr search performance
Posted by 李银松 <le...@gmail.com>.
I will try what u suggested !
Thanks a lot~
在08-4-9,Leonardo Santagada <sa...@gmail.com> 写道:
>
>
> On 09/04/2008, at 00:24, 李银松 wrote:
>
> > most of time seems to be used for the writer getting and writing the
> > docs
> > can those docs prefetched?
> >
>
>
> There is a cache on solr... if you really want it you could make the cache
> and the jvm as big as your memory it should probably fit most of the 10gb
> index. How to config this you can look on the solr wiki pages.
>
> Do you need all the fields on the documents? you can also make the index
> only contain the things needed for search and retrieve the actual record
> data from your database when the user select an item from the results or
> something like this.
>
> probably tomorrow someone with more solr knoledge is going to give you a
> better answer.
>
> good luck,
> --
> Leonardo Santagada
>
>
>
>
>
Re: How to improve Solr search performance
Posted by Leonardo Santagada <sa...@gmail.com>.
On 09/04/2008, at 00:24, 李银松 wrote:
> most of time seems to be used for the writer getting and writing the
> docs
> can those docs prefetched?
There is a cache on solr... if you really want it you could make the
cache and the jvm as big as your memory it should probably fit most of
the 10gb index. How to config this you can look on the solr wiki pages.
Do you need all the fields on the documents? you can also make the
index only contain the things needed for search and retrieve the
actual record data from your database when the user select an item
from the results or something like this.
probably tomorrow someone with more solr knoledge is going to give you
a better answer.
good luck,
--
Leonardo Santagada
Re: How to improve Solr search performance
Posted by "Eason.Lee" <le...@gmail.com>.
>
>
> can you be more specific about what you mean when you say "And I got the
> time from dispatchfilter..." What *exactly* are you looking at (ie: is
> this a time you are seeing in a log file? ifso which log file? ... is this
> timing code you added to the dispatch filter yourself? what *exactly* are
> you looking at?)
the time code is added by myself
I was just testing the solr performance
And I found that avg request time is much longer than QTime(T1)
So I added some code timing the whole SoleDispatchFilter.doFilter()
method(T2)
The time(T2-T1) is used for the the responseWriter writing the document.
Deep into it, most of time cost here:
public void writeDocs(boolean includeScore, Set<String> fields) throws
IOException {
SolrIndexSearcher searcher = request.getSearcher();
DocIterator iterator = ids.iterator();
int sz = ids.size();
includeScore = includeScore && ids.hasScores();
for (int i=0; i<sz; i++) {
int id = iterator.nextDoc();
Document doc = searcher.doc(id, fields);
writeDoc(null, doc, fields, (includeScore ? iterator.score() :
0.0f), includeScore);
}
}
If I set the documentCache to a larger size, the time spend here could
be much lower
>
> How big is the text field? Are you talking about a few hundred chars or
> several KB of text per doc?
several KB
Is <enableLazyFieldLoading> set to true in your solrconfig.xml?
It has set to true
Re: How to improve Solr search performance
Posted by Chris Hostetter <ho...@fucit.org>.
: 1) how are you timing this (ie: what exactly are you measuring)
: And I got the time from dispatchfilter received the request to
: responsewriter write the response
: It is much larger than QTime.
can you be more specific about what you mean when you say "And I got the
time from dispatchfilter..." What *exactly* are you looking at (ie: is
this a time you are seeing in a log file? ifso which log file? ... is this
timing code you added to the dispatch filter yourself? what *exactly* are
you looking at?)
I ask because it's possible there is included network IO overhead in
communicating with your client (i would be suprised if it was significant
if you are only returning a single field for the first 50 results, but i
know nothing about your network setup, or what your client code look ike
-- so anythign is possible.
: 7-9 fields
: only one of the fields is text, rest of them are short string or int ...
How big is the text field? Are you talking about a few hundred chars or
several KB of text per doc?
Is <enableLazyFieldLoading> set to true in your solrconfig.xml?
(I forgot we had that option when i sent my last email, as long
as you are using the "fl" param with just your uniqueKey field document
retrieval should be "fast enough" and fairly consistent.
-Hoss
Re: How to improve Solr search performance
Posted by 李银松 <le...@gmail.com>.
2008/4/9, Chris Hostetter <ho...@fucit.org>:
>
>
> : most of time seems to be used for the writer getting and writing the
> docs
> : can those docs prefetched?
>
> as mentiond, the documentCache can help you out in the common case, but
> 1-4 seconds for just the XMLWriting seems pretty high ...
It really works thanks
1) how are you timing this (ie: what exactly are you measuring)
The QTime it the time used for solr to find the docs
And I got the time from dispatchfilter received the request to
responsewriter write the response
It is much larger than QTime.
2) how many stored fields do each of your documents have? (not how many are
> in your schema.xml, how many do each of your docs really have in them)
7-9 fields
only one of the fields is text, rest of them are short string or int ...
> ...having *lots* of stored fields can slow down retrieval of the Document
> (and Document retrival is delayed untill response writing) so if you have
> thousands thta night account for it. If you're use case is to only ever
> return the "ID" field, then not storing anything else will help keep your
> total index size smaller and should speed up the response writing.
>
>
>
>
> -Hoss
>
>
Re: How to improve Solr search performance
Posted by Chris Hostetter <ho...@fucit.org>.
: most of time seems to be used for the writer getting and writing the docs
: can those docs prefetched?
as mentiond, the documentCache can help you out in the common case, but
1-4 seconds for just the XMLWriting seems pretty high ...
1) how are you timing this (ie: what exactly are you measuring)
2) how many stored fields do each of your documents have? (not how many
are in your schema.xml, how many do each of your docs really have in them)
...having *lots* of stored fields can slow down retrieval of the Document
(and Document retrival is delayed untill response writing) so if you have
thousands thta night account for it. If you're use case is to only ever
return the "ID" field, then not storing anything else will help keep your
total index size smaller and should speed up the response writing.
-Hoss
Re: How to improve Solr search performance
Posted by 李银松 <le...@gmail.com>.
most of time seems to be used for the writer getting and writing the docs
can those docs prefetched?
2008/4/9, Leonardo Santagada <sa...@gmail.com>:
>
>
> On 08/04/2008, at 23:13, 李银松 wrote:
>
> > I'm testing solr search performance using LoadRunner
> > the index contains 5M+ docs , about 10.7GB large.
> > CPU:3.2GHz*2 RAM16GB
> > The result si dispirited
> > max:19s min 1.5s avg 11.7s
> > But the QTime is around 1s
> > (simple query without facet or mlt,just fetch the top 50 IDs)
> > So it seems that XMLWriter is the bottleneck
> > Am I right? Or is there anything i can do to improve the performance?
> >
>
>
> Are you limiting the results? Because if you are not writing even a tiny
> portion of those 10gb can take 11secs for sure. If you can please see the
> diference from writing xml to writing json data.
>
> --
> Leonardo Santagada
>
>
>
>
>
Re: How to improve Solr search performance
Posted by 李银松 <le...@gmail.com>.
limiting the results? How?
I had set rows=50 fl=ID
is it what u said for limiting the results?
When I switch to writing json data, the result is better
max:14.8s min:0.1s avg:8.7
Error:QTime is around 1-4s ,not 1s
2008/4/9, Leonardo Santagada <sa...@gmail.com>:
>
>
> On 08/04/2008, at 23:13, 李银松 wrote:
>
> > I'm testing solr search performance using LoadRunner
> > the index contains 5M+ docs , about 10.7GB large.
> > CPU:3.2GHz*2 RAM16GB
> > The result si dispirited
> > max:19s min 1.5s avg 11.7s
> > But the QTime is around 1s
> > (simple query without facet or mlt,just fetch the top 50 IDs)
> > So it seems that XMLWriter is the bottleneck
> > Am I right? Or is there anything i can do to improve the performance?
> >
>
>
> Are you limiting the results? Because if you are not writing even a tiny
> portion of those 10gb can take 11secs for sure. If you can please see the
> diference from writing xml to writing json data.
>
> --
> Leonardo Santagada
>
>
>
>
>
Re: How to improve Solr search performance
Posted by Leonardo Santagada <sa...@gmail.com>.
On 08/04/2008, at 23:13, 李银松 wrote:
> I'm testing solr search performance using LoadRunner
> the index contains 5M+ docs , about 10.7GB large.
> CPU:3.2GHz*2 RAM16GB
> The result si dispirited
> max:19s min 1.5s avg 11.7s
> But the QTime is around 1s
> (simple query without facet or mlt,just fetch the top 50 IDs)
> So it seems that XMLWriter is the bottleneck
> Am I right? Or is there anything i can do to improve the performance?
Are you limiting the results? Because if you are not writing even a
tiny portion of those 10gb can take 11secs for sure. If you can please
see the diference from writing xml to writing json data.
--
Leonardo Santagada