# Increase shards and replicas in new Index

**URL:** https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900
**Category:** Logstash
**Created:** [July 4, 2019, 11:21am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900 "2019-07-04T11:21:03Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![mrashid](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrashid](https://discuss.elastic.co/u/mrashid)
#### Post date: [July 4, 2019, 11:21am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/1 "2019-07-04T11:21:03Z")

</div>

In my logstash configuration I am creating Index daily with date using the below configuration :

```
 elasticsearch {
hosts => ["elkhost:9200"]
manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}-failurelogs"
document_type => "%{[@metadata][type]}" 

```

Now I want to create the index with higher shards for better memory utilization.

**How to configure index creation with higher shards and replicas on a daliy basis from the logstash configuration ?**

---

<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: [July 5, 2019, 8:00am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/2 "2019-07-05T08:00:49Z")

</div>

> [@mrashid](#):
>
> Now I want to create the index with higher shards for better memory utilization.

What do you mean by that? What problem are you trying to solve?

---

<div class="post-metadata">

### Author: ![mrashid](https://avatars.discourse-cdn.com/v4/letter/m/9fc348/32.png) [@mrashid](https://discuss.elastic.co/u/mrashid)
#### Post date: [July 5, 2019, 8:08am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/3 "2019-07-05T08:08:09Z")

</div>

My assumption was that if i create more shards and segregate the events into the shards , better memory utilization will be possible and in turn the serach results will be faster.

I came across a similar issue here : [Elasticsearch querying is terribly slow](https://discuss.elastic.co/t/elasticsearch-querying-is-terribly-slow/81144)

However , now I believe that because the amount of data in my case is 2 GB to max 12GB , I am better of maintaining 3 shards and increase the heap max /min in elastic search to 40 gb.

---

<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: [July 5, 2019, 8:16am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/4 "2019-07-05T08:16:56Z")

</div>

If you have 2GB of data per day and only keep a few days you do only need a single primary shard per daily index and likely no more than a 4GB heap.

---

<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: [July 5, 2019, 8:17am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/5 "2019-07-05T08:17:35Z")

</div>

> [@mrashid](#):
>
> My assumption was that if i create more shards and segregate the events into the shards , better memory utilization will be possible and in turn the serach results will be faster.

So your searches are slow?

---

<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 2, 2019, 8:17am UTC](https://discuss.elastic.co/t/increase-shards-and-replicas-in-new-index/188900/6 "2019-08-02T08:17:37Z")

</div>

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