Cache can play a major role in your deployment's performance. One of the caches that you can configure when setting up Solr is the document cache. It is responsible for storing the Lucene internal documents that have been fetched from the disk. The proper configuration of this cache can save precious I/O calls and therefore boost the whole deployment performance. This recipe will show you how to properly configure the document cache.
For the purpose of this recipe, I assumed that we are dealing with the deployment of Solr where we have about 100, 000 documents. In our case, a single Solr instance is getting a maximum of 10 concurrent queries and the maximum number of documents that a query can fetch is 256.
With the preceding parameters, our document cache should look similar to the following code snippet (add this code to the solrconfig.xml
configuration file):
<documentCache class="solr.LRUCache" size="2560" initialSize="2560"/>...