# How does elasticsearch decide how many shards can be restored in parallel

**URL:** <https://discuss.elastic.co/t/how-does-elasticsearch-decide-how-many-shards-can-be-restored-in-parallel/151139>\
**Category:** Elasticsearch\
**Created:** [October 5, 2018, 2:48am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-decide-how-many-shards-can-be-restored-in-parallel/151139 "2018-10-05T02:48:11Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jianzhou\_Z](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jianzhou_z/32/46751_2.png) [@Jianzhou\_Z](https://discuss.elastic.co/u/Jianzhou_Z)\
**Post date:** [October 5, 2018, 2:48am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-decide-how-many-shards-can-be-restored-in-parallel/151139/1 "2018-10-05T02:48:11Z")

</div>

I made a snapshot of an index with 24 shards. The index is of size 700g. When restoring, it restores 4 shards in parallel.

My cluster is a new cluster with only one machine w/o replica nodes. The machine is AWS c3.8xlarge with 32 vCPUs and 60G memory. I also followed [How to speed up Elasticsearch recovery?](https://stackoverflow.com/questions/42923775/how-to-speed-up-elasticsearch-recovery).

When restoring, the memory usage is full. How does elastic search decide how many shards can be restored in parallel? I was wondering how I can tune my machines' hardware config to make restore faster. If my cluster has more machines, can the restoring speed be improved linearly?

---

<div class="post-metadata">

**Author:** ![Christian\_Dahlqvist](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/christian_dahlqvist/32/4617_2.png) [@Christian\_Dahlqvist](https://discuss.elastic.co/u/Christian_Dahlqvist)\
**Post date:** [October 5, 2018, 5:48am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-decide-how-many-shards-can-be-restored-in-parallel/151139/2 "2018-10-05T05:48:50Z")

</div>

I recall the restoration of snapshots using the recovery mechanism, which [can be tuned through these cluster settings](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/shards-allocation.html).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 2, 2018, 5:49am UTC](https://discuss.elastic.co/t/how-does-elasticsearch-decide-how-many-shards-can-be-restored-in-parallel/151139/3 "2018-11-02T05:49:01Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
