# Proper shard and replica settings

**URL:** https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433
**Category:** Elasticsearch
**Created:** [July 3, 2024, 8:07am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433 "2024-07-03T08:07:16Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)
#### Post date: [July 3, 2024, 8:07am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/1 "2024-07-03T08:07:16Z")

</div>

Hello, Elastic!

I'm planning to modify shard and replica settings cause mine is not resonable.

I have 5 types of indices which sized 30MB, 2GB, 25GB, 35GB, 200GB and each of them have 2 sets(live and indexing indices per each).  
Now, every indices set as 2 shards and 5 replicas.

As I learned here, each shards should be around 20-50GB.  
So I'm planning

- 30MB, 2GB index: 1 shard
- 25GB, 35GB index: 2 shards
- 200GB index: 5 shards  
is it proper?

I heard that the number of replica affect to the search performance, so that, I'm wondering what number of replica is resonable when the service traffic is over 2,000 in general, and over 10,000 per second in a specific period?

Thank you in advance.

---

<div class="post-metadata">

### Author: ![Kathleen\_DeRusso](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kathleen_derusso/32/132039_2.png) [@Kathleen\_DeRusso](https://discuss.elastic.co/u/Kathleen_DeRusso)
#### Post date: [July 3, 2024, 12:10pm UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/2 "2024-07-03T12:10:45Z")

</div>

The shard and replica count really depends on a lot of factors - including document size, the number and types of queries you'll be running, mappings, etc. Our best, recommended way to know the ideal sharding strategy for your use case is to benchmark your data with the types of indexing and search loads you expect.

You may find our [sizing guide](https://www.elastic.co/guide/en/elasticsearch/reference/current/size-your-shards.html) helpful as well.

---

<div class="post-metadata">

### Author: ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)
#### Post date: [July 8, 2024, 1:52am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/3 "2024-07-08T01:52:11Z")

</div>

I've read the page you guided several times, however, it is still difficult to decide..

All aside..  
If i have 20 nodes and a 30GB-primary index, which can have better search or index performance?  
Or at least, what would you choose, if you were me..

- 2 shards (15GB each) 5 replica = 2 \* (5+1) = 12 shards total
- 4 shards (7.5GB each) 2 replica = 4 \* (2+1) = 12 shards total

My question is, what could be the main factor for the better performance between shards and replicas.  
Of course, I know that there are so many factors but still I'm facing to choose the balance. 🥲

---

<div class="post-metadata">

### Author: ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)
#### Post date: [July 8, 2024, 3:47am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/4 "2024-07-08T03:47:55Z")

</div>

From #Elastic Search to #Elasticsearch

---

<div class="post-metadata">

### Author: ![DavidTurner](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/davidturner/32/22453_2.png) [@DavidTurner](https://discuss.elastic.co/u/DavidTurner)
#### Post date: [July 8, 2024, 5:10am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/5 "2024-07-08T05:10:36Z")

</div>

> [@HyebinHong](#):
>
> I've read the page you guided several times, however, it is still difficult to decide..

The linked page includes a [section](https://www.elastic.co/guide/en/elasticsearch/reference/current/size-your-shards.html#shard-size-recommendation) entitled _"Aim for shards of up to 200M documents, or with sizes between 10GB and 50GB"_ which I think answers your question. With 4 shards each shard would be less than 10GiB which is smaller than recommended. 2x15GiB shards would be within the recommended range, but so would 1x30GiB shard.

> [@HyebinHong](#):
>
> My question is, what could be the main factor for the better performance between shards and replicas.

Almost certainly not this. Or at least, some workloads will get better results with 1x30GiB primary shard and others might do better with 2x15GiB primary shards. There's no way to be sure without [benchmarking](https://esrally.readthedocs.io/en/stable/) both setups using your specific workload and data.

---

<div class="post-metadata">

### Author: ![HyebinHong](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hyebinhong/32/122465_2.png) [@HyebinHong](https://discuss.elastic.co/u/HyebinHong)
#### Post date: [July 8, 2024, 5:19am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/6 "2024-07-08T05:19:54Z")

</div>

> [@DavidTurner](#):
>
> The linked page includes a [section](https://www.elastic.co/guide/en/elasticsearch/reference/current/size-your-shards.html#shard-size-recommendation) entitled

Yes, definately. My options were not properly representing the point.  
Anyway.. all of you guys said it is up to various factors, I will check that I'm able to set and run Rally for our running service.

Thank you all!

---

<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: [August 5, 2024, 5:19am UTC](https://discuss.elastic.co/t/proper-shard-and-replica-settings/362433/7 "2024-08-05T05:19:58Z")

</div>

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