On 1/27/2016 8:11 PM, Zheng Lin Edwin Yeo wrote: > I would like to find out, is the cache in the Solr cleared when I shut down > the Solr instant and restart it? > > I am suspecting that the cache is not entirely cleared, because when I try > to do a search on the same query as I did before the search, it still has a > return QTime that is much faster than the initial search. However, when I > do a search on a new query, the return QTime is the original speed. > > I am using Solr 5.4.0, and this is my setting for the queryResultCache. > > <queryResultCache class="solr.LRUCache" > size="1024" > initialSize="512" > autowarmCount="0"/>
The Solr caches are maintained in the Java heap, which is lost when Java stops. Although the Solr caches are not preserved across a restart, the operating system does cache actual index data in main memory, so when Solr asks for the same index data off of the disk again, it is pulled directly from RAM, which is a LOT faster than the disk. In order to deliver good performance, Solr is extremely reliant on this built-in feature of all modern operating systems, so there must be enough spare memory for good caching. Here are a couple of pages with some more detail: https://wiki.apache.org/solr/SolrPerformanceProblems https://en.wikipedia.org/wiki/Page_cache Thanks, Shawn