Thanks a lot for the reply Shawn! That makes sense.

Thanks,
Shahsank

On 8/17/17, 11:37 AM, "Shawn Heisey" <apa...@elyograg.org> wrote:

    On 8/14/2017 8:19 PM, Shashank Pedamallu wrote:
    > I was looking for a reliable method to check if my core was in a
    > consistent readable state and came across
    > org.apache.lucene.index.CheckIndex class. However, when I tried to run
    > this command multiple times from the command-line via the main utility
    > method provided, it takes long time to run for the first time, while
    > subsequent runs are much much faster. Can someone explain why this is?
    > Does Solr/Lucene cache the results of CheckIndex? Note that the
    > attempt runs are on the same core with same segments.
    
    This is indeed a Lucene question, but that doesn't mean it will get
    ignored.  If you want more detail than this, try the Lucene java-user
    mailing list.
    
    This is probably the OS caching the index files.  Lucene itself does not
    cache the data, especially from separate invocations of CheckIndex, but
    the operating system does.
    
    The first time you run it, your server may need to actually read all the
    index data from the disk, so you're dealing with the speed of the disk
    as a bottleneck.  The second time, part or possibly all of the index
    data will have been cached by the operating system in memory, so it
    loads MUCH faster, because it's pulled from memory, not the actual disk.
    
    Thanks,
    Shawn
    
    

Reply via email to