# Shards Distribution in Multiple disks

**URL:** <https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489>\
**Category:** Elasticsearch\
**Created:** [February 26, 2018, 1:07pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489 "2018-02-26T13:07:29Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![moni15moni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moni15moni/32/42311_2.png) [@moni15moni](https://discuss.elastic.co/u/moni15moni)\
**Post date:** [February 26, 2018, 1:07pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/1 "2018-02-26T13:07:30Z")

</div>

Hi

I would like to know the shards allocation in between the Disks in the ES Nodes . I have the cluster which have 6 data nodes - Each node have a 4 disks of  
/data/disk001, /data/disk002, /data/disk003, /data/disk004 (Spinning ) each 512 GB.

When I am creating index with 6 shards, Which disk the shards will allocated ,Is there any formula/calculation ?

How the indexing performance will be in this node?

If the shards are allocated into each disk, can we increase the no of shards to 6 ES Nodes \*  
4 Disks = 24 shards for each index to make indexing performance?

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [February 26, 2018, 8:46pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/2 "2018-02-26T20:46:05Z")

</div>

Two main default rules determine placement:

1. Replicas won't be placed on the same node as the primary shard, even if it's on a different disk
2. Disks full enough to trigger the low/high [watermarks](https://www.elastic.co/guide/en/elasticsearch/reference/current/disk-allocator.html)

Easiest thing to do is just try it and see where things land:

```auto
PUT mohankumar_test
{
    "settings" : {
        "index" : {
            "number_of_shards" : 24, 
            "number_of_replicas" : 1 
        }
    }
}

```

As for performance, it seems likely that you'll get better indexing performance using 24 shards than, say, 12 shards. Use [Rally](https://github.com/elastic/rally) to benchmark a few different configurations so you have better data to guide your decisions.

---

<div class="post-metadata">

**Author:** ![moni15moni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moni15moni/32/42311_2.png) [@moni15moni](https://discuss.elastic.co/u/moni15moni)\
**Post date:** [February 27, 2018, 6:48am UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/3 "2018-02-27T06:48:58Z")

</div>

Thanks loren,

I would like to know the allocation of disk utilization

sda  
sdb  
sdc  
sdd

In the above 4 disks , which disk involve to indexing with shards, I hope the single shard not spread with other 4 disks. A single shard is mapped with individual disk. SO what will be the calculation of assigning shards to the disks

---

<div class="post-metadata">

**Author:** ![loren](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/loren/32/44942_2.png) [@loren](https://discuss.elastic.co/u/loren)\
**Post date:** [February 27, 2018, 5:41pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/4 "2018-02-27T17:41:11Z")

</div>

Correct, a single shard will only live on one disk. As for which disks get the allocation, my understanding/experience is that the allocator attempts to balance the shard count, not the disk usage. So let's say you have:

1. sda, 70% full, 10 shards
2. sdb, 10% full, 12 shards
3. sdc, 10% full, 12 shards
4. sdd, 10% full, 12 shards

If you create a new single shard index, you might think it would go to one of the 3 nearly empty disks. Instead it'll pile on to the 70% full disk, because it only has 10 shards.

Now, once that 70% full disk becomes 85% full, the default disk threshold watermark will kick in and it won't get assigned new shards.

---

<div class="post-metadata">

**Author:** ![moni15moni](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/moni15moni/32/42311_2.png) [@moni15moni](https://discuss.elastic.co/u/moni15moni)\
**Post date:** [February 27, 2018, 5:44pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/5 "2018-02-27T17:44:02Z")

</div>

Thanks for sharing your experience loren

---

<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:** [March 27, 2018, 5:44pm UTC](https://discuss.elastic.co/t/shards-distribution-in-multiple-disks/121489/6 "2018-03-27T17:44:16Z")

</div>

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