# Too many shards, 1960 of them

**URL:** <https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823>\
**Category:** Elasticsearch\
**Created:** [January 25, 2017, 9:48pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823 "2017-01-25T21:48:09Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![tarp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarp/32/51884_2.png) [@tarp](https://discuss.elastic.co/u/tarp)\
**Post date:** [January 25, 2017, 9:48pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/1 "2017-01-25T21:48:09Z")

</div>

Hi,  
Originally like most users I had one index logstash-\*. Since I have been implementing Elasticsearch, it seemed reasonable to define new indexes for each application or group of apps. This has led me to the above problem, I have too many indexes and too many shards, 1960.  
For a given day I have 11 different indexes, the biggest is topbeat at 175GB and the smallest is a tomcat log index at 4MB.  
The average is about 30GB each.  
Is this a bad idea to break out my indexes per application? Should I put them all in one or two?  
My rationale for breaking them up was that if I wanted different index retention for different indexes I could set that up. As it turns out I'm keeping everything the same amount of time.  
Any thoughts on this?  
Thanks,  
Tim

---

<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 25, 2017, 11:10pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/2 "2017-01-25T23:10:25Z")

</div>

> [@tarp](#):
>
> Is this a bad idea to break out my indexes per application? Should I put them all in one or two?

It's a good idea.

Use the `_shrink` API to reduce them down a day or two after they have rolled over 🙂

---

<div class="post-metadata">

**Author:** ![tarp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarp/32/51884_2.png) [@tarp](https://discuss.elastic.co/u/tarp)\
**Post date:** [January 26, 2017, 1:56pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/3 "2017-01-26T13:56:25Z")

</div>

Currently I'm running ES 2.4 and doing the upgrade migration plugin. I'm getting this,  
Total primary shardsℹ  
In 5.x, a maximum of 1000 shards can be queried in a single request. This cluster has 1955 primary shards.

What can/should I do about this?

---

<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 26, 2017, 7:45pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/4 "2017-01-26T19:45:35Z")

</div>

That only applies to shards being queried, eg through Kibana. It won't stop the upgrade 🙂

---

<div class="post-metadata">

**Author:** ![tarp](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/tarp/32/51884_2.png) [@tarp](https://discuss.elastic.co/u/tarp)\
**Post date:** [January 26, 2017, 9:00pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/5 "2017-01-26T21:00:26Z")

</div>

Good, that makes sense. Thanks, for the reply.

---

<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 23, 2017, 9:00pm UTC](https://discuss.elastic.co/t/too-many-shards-1960-of-them/72823/6 "2017-02-23T21:00:39Z")

</div>

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