Configuring Index Cache Pre-Loading

In addition to the Disk Cache setting, you can also specify that segments of the index for a collection be pre-loaded into the allocated cache. By default, the indexer loads portions of the index into memory as required, which means that the first few queries against an index will be slower than subsequent searches because they require disk I/O. Cache preloading allows the indexer to load portions of the index into memory when the indexer is started or when new index files are created, instead of at search time.

Important: For each index file, the indexer only preloads index segments that will completely fit into the index cache. See Overview of Index Files and Structure for a discussion of index segments and their priority when being considered for caching.

Cache preloading is a per-collection setting that is configured by modifying the value of the Cache preloader setting, which is available in the Advanced section of the Configuration > Searching tab for a collection. The default value of this option is 0, meaning that no cache preloading is done. Setting a non-zero value for this option enables cache preloading, and also defines the number of blocks from an index segment that will be preloaded into the cache as a single unit.

For example, if the Cache preloader option is set to 1, the indexer will attempt to load index segments that can be preloaded by reading them one block at a time. If this option was set to 100, the indexer would attempt to load these segments 100 blocks at a time. The number of blocks that are being loaded as a unit is important because index blocks cannot be searched while they are being loaded into memory. The recommended setting for this option is 128 blocks, which is large enough to improve cache preloading speed while not interrupting or degrading search performance. The Cache pause option enables you to specify a delay between preloading each Cache preloader unit of blocks.

Cache preloading is best used when the frequency of index updates is lower than the number of queries. Each time that a collection's index is refreshed, the updated index segments must be reloaded into the cache. Preloading is therefore most commonly used with search collections that are refreshed hourly, nightly, or even less frequently.