You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by ST ST <st...@gmail.com> on 2010/05/19 23:19:09 UTC

Query Timings increase after system is idle

Folks,

We have a problem in our environment where after a system is idle the query
time goes up from a few 100ms to 4+ seconds after 9 hours of idle time on
the system.

System Details:
 - Solr 1.4 with Lucene 2.9
 - 10 Million Index.
 - Use MMAP for mapping the index files in memory

Test Details:
-  8 hour performance run with ingestion (@ 8 docs/sec) , query rate - 3
Queries per sec.
-  Commit is per hour.

Issue:
- After 9 hours of idle time (ie no queries, no ingestion ) every query
takes 4+ seconds, subsequent queries are fast.

I have a few specific questions:
A. Does Lucene/Solr have internal caches which may be flushed out of memory
when the system is idle ?
B. What operations are done on a per term basis (example: build doc lists )
for first time queries.
C. Any pointers to what else may be an issue here.

Really appreciate any help you can provide.

ST

Re: Query Timings increase after system is idle

Posted by Otis Gospodnetic <ot...@yahoo.com>.
Hi,

You are most likely seeing the effects of your previously cached (by the OS) index data getting paged out of the cache by other disk and process data.  The OS is doing the right thing - if nobody is using index data, why keep it in memory when that memory could be used for other things.

Is this happening under Linux?  If so, this "swappiness" can be controlled: http://kerneltrap.org/node/3000

 Otis
----
Sematext :: http://sematext.com/ :: Solr - Lucene - Nutch
Lucene ecosystem search :: http://search-lucene.com/


>
>From: ST ST <st...@gmail.com>
>To: dev@lucene.apache.org
>Sent: Wed, May 19, 2010 5:19:09 PM
>Subject: Query Timings increase after system is idle
>
>Folks,
>
>
>We have a problem in our environment where after a system is idle the query time goes up from a few 100ms to 4+ seconds after 9 hours of idle time on the system.
>
>System Details:
>> - Solr 1.4 with Lucene 2.9
> - 10 Million Index.
>> - Use MMAP for mapping the index files in memory
>
>Test Details:
>-  8 hour performance run with ingestion (@ 8 docs/sec) , query rate - 3 Queries per sec.
>-  Commit is per hour.
>
>Issue:
>- After 9 hours of idle time (ie no queries, no ingestion ) every query takes 4+ seconds, subsequent queries are fast.
>
>I have a few specific questions:
>A. Does Lucene/Solr have internal caches which may be flushed out of memory when the system is idle ?
>B. What operations are done on a per term basis (example: build doc lists ) for first time queries.
>>
>C. Any pointers to what else may be an issue here.
>
>Really appreciate any help you can provide.
>
>ST
>
>
>
>
>
>
>

Re: Query Timings increase after system is idle

Posted by ST ST <st...@gmail.com>.
Thanks for the response, Mike.

In our solution, the entire index is memory mapped.


On Thu, May 20, 2010 at 2:05 PM, Mike Klaas <mi...@gmail.com> wrote:

> Solr and Lucene rely on the OS disk cache for speedy queries.  If they
> are left idle for hours while the disk is used for other purposes, the
> OS will page out some of the lucene index (and it will have to be
> paged back in the next time a query is received).
>
> The best way to prevent this from occurring is to set up a periodic
> automatic query using crontab that keeps the system warm.
>
> cheers,
> -Mike
>
> On Wed, May 19, 2010 at 2:19 PM, ST ST <st...@gmail.com> wrote:
> > Folks,
> >
> > We have a problem in our environment where after a system is idle the
> query
> > time goes up from a few 100ms to 4+ seconds after 9 hours of idle time on
> > the system.
> >
> > System Details:
> >  - Solr 1.4 with Lucene 2.9
> >  - 10 Million Index.
> >  - Use MMAP for mapping the index files in memory
> >
> > Test Details:
> > -  8 hour performance run with ingestion (@ 8 docs/sec) , query rate - 3
> > Queries per sec.
> > -  Commit is per hour.
> >
> > Issue:
> > - After 9 hours of idle time (ie no queries, no ingestion ) every query
> > takes 4+ seconds, subsequent queries are fast.
> >
> > I have a few specific questions:
> > A. Does Lucene/Solr have internal caches which may be flushed out of
> memory
> > when the system is idle ?
> > B. What operations are done on a per term basis (example: build doc lists
> )
> > for first time queries.
> > C. Any pointers to what else may be an issue here.
> >
> > Really appreciate any help you can provide.
> >
> > ST
> >
> >
> >
> >
> >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
> For additional commands, e-mail: dev-help@lucene.apache.org
>
>

Re: Query Timings increase after system is idle

Posted by Mike Klaas <mi...@gmail.com>.
Solr and Lucene rely on the OS disk cache for speedy queries.  If they
are left idle for hours while the disk is used for other purposes, the
OS will page out some of the lucene index (and it will have to be
paged back in the next time a query is received).

The best way to prevent this from occurring is to set up a periodic
automatic query using crontab that keeps the system warm.

cheers,
-Mike

On Wed, May 19, 2010 at 2:19 PM, ST ST <st...@gmail.com> wrote:
> Folks,
>
> We have a problem in our environment where after a system is idle the query
> time goes up from a few 100ms to 4+ seconds after 9 hours of idle time on
> the system.
>
> System Details:
>  - Solr 1.4 with Lucene 2.9
>  - 10 Million Index.
>  - Use MMAP for mapping the index files in memory
>
> Test Details:
> -  8 hour performance run with ingestion (@ 8 docs/sec) , query rate - 3
> Queries per sec.
> -  Commit is per hour.
>
> Issue:
> - After 9 hours of idle time (ie no queries, no ingestion ) every query
> takes 4+ seconds, subsequent queries are fast.
>
> I have a few specific questions:
> A. Does Lucene/Solr have internal caches which may be flushed out of memory
> when the system is idle ?
> B. What operations are done on a per term basis (example: build doc lists )
> for first time queries.
> C. Any pointers to what else may be an issue here.
>
> Really appreciate any help you can provide.
>
> ST
>
>
>
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org