# Index has too many segments

**URL:** <https://discuss.elastic.co/t/index-has-too-many-segments/165200>\
**Category:** Elasticsearch\
**Created:** [January 22, 2019, 9:29am UTC](https://discuss.elastic.co/t/index-has-too-many-segments/165200 "2019-01-22T09:29:00Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ihenrypan](https://avatars.discourse-cdn.com/v4/letter/i/848f3c/32.png) [@ihenrypan](https://discuss.elastic.co/u/ihenrypan)\
**Post date:** [January 22, 2019, 9:29am UTC](https://discuss.elastic.co/t/index-has-too-many-segments/165200/1 "2019-01-22T09:29:01Z")

</div>

Hi, I have an index has too many segments(more than 7000).  
When I restore the index from snapshot, segment number is 340(index has 170 shards). After spark-streaming write data to index in few days, the segment number is increase. As shown in the jpg:

 ![toomanysegmengs](https://us1.discourse-cdn.com/elastic/original/3X/6/c/6c7b80cc065e5b7c39da7c059b3ddcfb22cee5a6.jpeg)

other info:  
es version: 2.3.5  
index.refresh\_interval: 3s  
index size: about 560gb  
disk:rotational disk  
per shard size: about 1.6gb

Thank you!

---

<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:** [January 22, 2019, 11:54am UTC](https://discuss.elastic.co/t/index-has-too-many-segments/165200/2 "2019-01-22T11:54:22Z")

</div>

If you have a slow disk it is quite possible that Elasticsearch segment merging can not keep up if you are indexing heavily. Have you followed the guidelines outlined [here](https://www.elastic.co/guide/en/elasticsearch/guide/2.x/indexing-performance.html)?

Given that you are on a very old version I would also recommend upgrading.

---

<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 19, 2019, 11:54am UTC](https://discuss.elastic.co/t/index-has-too-many-segments/165200/3 "2019-02-19T11:54:24Z")

</div>

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