# How to set the shard and replica to tune the ES performance?

**URL:** <https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733>\
**Category:** Elasticsearch\
**Created:** [January 31, 2018, 3:46am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733 "2018-01-31T03:46:59Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [January 31, 2018, 3:47am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733/1 "2018-01-31T03:47:00Z")

</div>

Hi everyone, my everyday documents is about 20 million records and one index per day.  
I know the default setting is 5 shards 1 replica per index.  
should I change the setting such as 3 shards and 2 replica, and does the setting performance be better or not?  
How can I tune the shards and replica to improve my ES system performance and maintain the durability?  
btw, I set 4 nodes in a cluster.

thank you in advance!

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [January 31, 2018, 3:48am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733/2 "2018-01-31T03:48:51Z")

</div>

> [@f26227279](#):
>
> should I change the setting such as 3 shards and 2 replica, and does the setting performance be better or not?

Have you tested it?

---

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [January 31, 2018, 3:58am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733/3 "2018-01-31T03:58:47Z")

</div>

No.because I don't know what setting is the best.  
I have no concept ☹

my index is about logstash-2018.01.31 logstash-2018.01.30 logstash-2018.01.29......  
Is this setting can affect all the index include future index which is logstash-\*?

```
PUT /logstash-*/_settings
{
    "index" : {
        "number_of_replicas" : 1
    }
}
```

---

<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:** [January 31, 2018, 7:15am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733/4 "2018-01-31T07:15:17Z")

</div>

May I suggest you look at the following resources about sizing:

[https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing](https://www.elastic.co/elasticon/conf/2016/sf/quantitative-cluster-sizing)

> **[How many shards should I have in my Elasticsearch cluster?
	  	 | Elastic](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster)**
>
> Elasticsearch is a very versatile platform, that supports a variety of use cases, and provides great flexibility around data organisation and replication strategies. This flexibility can however somet...

> **[NetSecureDay: Managing your Black Friday Logs](https://speakerdeck.com/elastic/netsecureday-managing-your-black-friday-logs)**
>
> Surveiller une application complexe n’est pas une tâche aisée, mais avec les bons outils, ce n’est pas si sorcier. Néanmoins, des périodes fortes telles que les opérations de type « Black Friday » (Vendredi noir) ou période de Noël peuvent pousser...

---

<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:** [February 28, 2018, 7:15am UTC](https://discuss.elastic.co/t/how-to-set-the-shard-and-replica-to-tune-the-es-performance/117733/5 "2018-02-28T07:15:28Z")

</div>

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