PG Services Canada

Tips to Speed Up Your Elasticsearch Reindexing

Reindexing large datasets in Elasticsearch can be resource-intensive. Use these practical tips to make the process faster and avoid unnecessary strain on your cluster.

1. Temporarily Turn Off Replicas

When building a new index that isn’t yet serving live search traffic, reduce replicas to zero. This minimizes write amplification. Once reindexing finishes, you can scale replicas back up dynamically.

2. Pause the Refresh Interval

Disable the refresh_interval during reindexing. This stops Elasticsearch from making frequent segment refreshes, allowing it to focus entirely on ingesting data. After the process is complete, re-enable it to restore near real-time search.

3. Use the Bulk API with Parallel Clients

Batch your indexing operations with the Bulk API, and run multiple parallel clients to push data. Be sure to benchmark your cluster first to avoid overwhelming it.

4. Increase Index Buffer Size

Adjust the index buffer size to allow more in-memory staging of writes before flushing to disk. This can reduce the frequency of merges and improve throughput.

5. Use the Reindex API for Analyzer Changes

If you’ve enabled the _source field and need to rebuild data with new analyzers (or other breaking changes), use Elasticsearch’s built-in Reindex API to copy data safely from the old index to the new one.

6. Tweak Merge Throttling (Legacy Clusters)

On Elasticsearch versions prior to 6.x, you can disable merge throttling by setting indices.store.throttle.type to none. For heavy write operations, this can speed up indexing — but monitor carefully, as it shifts more work to the disks.

7. Plan Shards Smartly to Avoid Hotspots

Choosing the right number of primary shards is key for long-term scalability and can’t be changed after creation. Balance your shard count to distribute data evenly and avoid overloading specific nodes.

Looking to optimize your Elasticsearch reindexing or large-scale migrations?

Talk to PG Services Canada for tailored cluster tuning, capacity planning, and end-to-end Elasticsearch optimization.

Reach Out to PG Services

Your future isn’t broken—it’s waiting to be built.