# Performance degrading after a couple of weeks

**URL:** https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241
**Category:** Elasticsearch
**Created:** [September 27, 2018, 6:42pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241 "2018-09-27T18:42:04Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![S\_Chase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_chase/32/33237_2.png) [@S\_Chase](https://discuss.elastic.co/u/S_Chase)
#### Post date: [September 27, 2018, 6:42pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/1 "2018-09-27T18:42:04Z")

</div>

on ES 6.4: I'm finding that over the course of 20 days Elastic Stack grinds to a very slow crawl. JVM heap gets to 99.9% and nearly everything times out. if I close indexes over the previous couple of weeks JVM moves to \<50% and it's smooth as silk again.

Any idea where to start looking?

---

<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: [September 27, 2018, 7:49pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/2 "2018-09-27T19:49:36Z")

</div>

How much data do you have in the cluster? How many indices and shards? Have you optimised your mappings?

---

<div class="post-metadata">

### Author: ![S\_Chase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_chase/32/33237_2.png) [@S\_Chase](https://discuss.elastic.co/u/S_Chase)
#### Post date: [September 27, 2018, 8:20pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/3 "2018-09-27T20:20:33Z")

</div>

It's about 16-20g a day, 5 indexes with all having 2 shards with the exception of one that has 5 shards.

I have mappings in for all but two indexes, one is very small \<5m/day the other is about 200m/day

---

<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: [September 28, 2018, 5:31am UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/4 "2018-09-28T05:31:43Z")

</div>

6 indices with a total of 15 primary shards is going to result in quite small shards. Over 20 days that is 300 shards. We generally recommend [having reasonably large shards](https://www.elastic.co/blog/how-many-shards-should-i-have-in-my-elasticsearch-cluster) as having lots of small ones can be inefficient.

It also sounds like you do not have enough heap space for the data and mappings you have in place. What is the specification of the nodes with respect to CPU, RAM and heap? What type of storage do you have? What is the size of the cluster? If you can share the full output of the [cluster stats API](https://www.elastic.co/guide/en/elasticsearch/reference/6.4/cluster-stats.html), it would also provide us with valuable information about the cluster.

---

<div class="post-metadata">

### Author: ![S\_Chase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_chase/32/33237_2.png) [@S\_Chase](https://discuss.elastic.co/u/S_Chase)
#### Post date: [September 28, 2018, 6:27pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/5 "2018-09-28T18:27:41Z")

</div>

Thank you for your reply. I guess I was totally misunderstanding how to allocate shards. I'll work on lowering that to 1 shard for each index and then merge.

just 1 node for everything right now. i'm not sure about the CPU Power but it's 8 processors, 8 gigs of ram, 2gig allocated to Heap, disk space is 500 gigs which a month or so fills up half of that. As far as I know it's regular magnetic disks.

---

<div class="post-metadata">

### Author: ![xeraa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/xeraa/32/48181_2.png) [@xeraa](https://discuss.elastic.co/u/xeraa)
#### Post date: [September 29, 2018, 1:59pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/6 "2018-09-29T13:59:57Z")

</div>

Assuming Elasticsearch is the only thing running on that node, we generally recommend to use 50% of the memory for the heap. 2GB sounds a bit small for your setup.

---

<div class="post-metadata">

### Author: ![S\_Chase](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/s_chase/32/33237_2.png) [@S\_Chase](https://discuss.elastic.co/u/S_Chase)
#### Post date: [October 2, 2018, 4:43pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/7 "2018-10-02T16:43:58Z")

</div>

i think the reason I had 2gb was logstash was tossing me jvm errors until I raised that on to 2gb also.

---

<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: [October 30, 2018, 4:44pm UTC](https://discuss.elastic.co/t/performance-degrading-after-a-couple-of-weeks/150241/8 "2018-10-30T16:44:00Z")

</div>

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