seamless_rotate
seamless_rotate
Prevents searchd stalls while rotating indexes with huge amounts of data to precache.
Optional, default is 1 (enable seamless rotation). On Windows systems seamless rotation is disabled by default.
Indexes may contain some data that needs to be precached in RAM.
At the moment, .spa, .spi and
.spm files are fully precached (they contain attribute data,
MVA data, and keyword index, respectively.)
Without seamless rotate, rotating an index tries to use as little RAM
as possible and works as follows:
- new queries are temporarily rejected (with “retry” error code);
searchdwaits for all currently running queries to finish;- old index is deallocated and its files are renamed;
- new index files are renamed and required RAM is allocated;
- new index attribute and dictionary data is preloaded to RAM;
searchdresumes serving queries from new index.
However, if there's a lot of attribute or dictionary data, then preloading step could take noticeable time - up to several minutes in case of preloading 1-5+ GB files.
With seamless rotate enabled, rotation works as follows:
- new index RAM storage is allocated;
- new index attribute and dictionary data is asynchronously preloaded to RAM;
- on success, old index is deallocated and both indexes' files are renamed;
- on failure, new index is deallocated;
- at any given moment, queries are served either from old or new index copy.
Seamless rotate comes at the cost of higher peak
memory usage during the rotation (because both old and new copies of
.spa/.spi/.spm data need to be in RAM while
preloading new copy). Average usage stays the same.
Example:
seamless_rotate = 1
