How Parallel Solr Indexing Works in the Turbo Indexer
Rounds, chunks and worker processes
How it works
drush ost works in rounds. In each round it gives every worker its own batch,
waits until all of them are done, then starts the next round.
One round, step by step
- The main process, the one
drush oststarts, takes the next items waiting in the Search API tracker for the current index: up to workers × batch items. With the defaults that is 10 × 200 = 2,000. It reads them straight from the tracker table, in item ID order. - It splits them into batches and writes each batch to its own chunk file.
- It starts one worker per batch, 50 ms apart. Each worker is a fresh Drush process: it loads its items and hands them to Search API, which sends them to Solr and marks them as indexed. Then the worker exits.
- When every worker of the round has exited, it deletes the chunk files and writes one progress line: percent done, items indexed in this run, items per second and the time left.
- It starts the next round, until nothing is waiting in this index. Then it moves on to the next index of the server.
What this means for you
- Workers never compete for items. Each one gets its own list before it starts.
- Stopping is safe. An item stops waiting only once Search API has indexed it. See Stop and resume.
- The indexes of a server go one after another, each with all the workers. To run two indexes at the same time, start one session per index: Several servers and indexes.
- A round lasts as long as its slowest worker. How that shapes your numbers: Workers and batch size.
Getting started
- Overview
- Requirements
- Install
- How it works