# Elasticsearch index creation / deletion incredibly slow

**URL:** https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305
**Category:** Elasticsearch
**Created:** [December 18, 2014, 4:20am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305 "2014-12-18T04:20:38Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Swaraj\_Banerjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swaraj_banerjee/32/1031_2.png) [@Swaraj\_Banerjee](https://discuss.elastic.co/u/Swaraj_Banerjee)
#### Post date: [December 18, 2014, 4:20am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305/1 "2014-12-18T04:20:38Z")

</div>

Hi all, I have a an ES cluster hosted on amazon with ~ 7000 indexes (most  
of which are sparsely populated \< 100 docs). Up till today, creating or  
deleting an index in the cluster took ~3 seconds. All of a sudden, creating  
or deleting an index is taking ~30 seconds. We have looked through all the  
logs and can't find anything. The cluster state is ~5.5MB, which doesn't  
seem big enough to be prohibitive.

Any thoughts on why this happened and how I can debug? Any help would be  
greatly appreciated.

Thanks,  
Swaraj

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/9d3827d3-3f0b-435d-b3e2-13f21c1187ab%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/9d3827d3-3f0b-435d-b3e2-13f21c1187ab%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![nik9000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/nik9000/32/44947_2.png) [@nik9000](https://discuss.elastic.co/u/nik9000)
#### Post date: [December 18, 2014, 4:52am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305/2 "2014-12-18T04:52:51Z")

</div>

On Dec 17, 2014 11:20 PM, "Swaraj Banerjee" [swarajban@gmail.com](mailto:swarajban@gmail.com) wrote:

> Hi all, I have a an ES cluster hosted on amazon with ~ 7000 indexes (most  
> of which are sparsely populated \< 100 docs). Up till today, creating or  
> deleting an index in the cluster took ~3 seconds. All of a sudden, creating  
> or deleting an index is taking ~30 seconds. We have looked through all the  
> logs and can't find anything. The cluster state is ~5.5MB, which doesn't  
> seem big enough to be prohibitive.

Standard warning that that is a lot. If possible try to squash them  
together somehow.

That aside I have the same number of indices and feel like I get better  
performance on created than you do. Not sure why though. I feel like my  
mapping updates are sluggish but don't know if that is caused by the number  
of indexes.

What part of index creation is taking 30 seconds? The rest call or the  
actual share assignment?

> Any thoughts on why this happened and how I can debug? Any help would be  
> greatly appreciated.

Are you getting swamped by other cluster admin actions? You should be able  
to get information about that from the cat API. Maybe also your cluster  
state exploded in size? Any change on CPU usage on the currently elected  
master? Any hot threads look like admin actions? Maybe hit it with jstack  
and look for admin actions there. They might not be hot threads but maybe  
there are lots running at once?

Nik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1gVjxgF5aoQ4jtDxfWpBuVit4%3DsgnYaV1LAV5ehs\_S1g%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAPmjWd1gVjxgF5aoQ4jtDxfWpBuVit4%3DsgnYaV1LAV5ehs_S1g%40mail.gmail.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

### Author: ![Swaraj\_Banerjee](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/swaraj_banerjee/32/1031_2.png) [@Swaraj\_Banerjee](https://discuss.elastic.co/u/Swaraj_Banerjee)
#### Post date: [December 18, 2014, 5:36am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305/3 "2014-12-18T05:36:50Z")

</div>

Thanks for the reply,

To answer your first question: how can I tell what part of the index  
creation is taking longer? When I make the REST call, it takes ~30 seconds  
before it is complete. As soon as I receive an HTTP response, however, the  
new index looks to be allocated and I can add documents to it.

To answer your second set of questions: I don't believe we are being  
swamped by other cluster admin actions. The only admin actions we are  
taking are index creation / deletion, and that is infrequently (few times  
per day). How can I get this information via cat API? I checked the cluster  
state file, and I don't believe it got significantly larger in size. What  
is a hot thread, a thread that is pinning CPU at 100%? How can I tell if a  
given thread is due to an admin action?

~ Swaraj

On Wednesday, December 17, 2014 8:53:34 PM UTC-8, Nikolas Everett wrote:

> On Dec 17, 2014 11:20 PM, "Swaraj Banerjee" \<[swar...@gmail.com](mailto:swar...@gmail.com)  
> \<javascript:\>\> wrote:
> 
> > Hi all, I have a an ES cluster hosted on amazon with ~ 7000 indexes  
> > (most of which are sparsely populated \< 100 docs). Up till today, creating  
> > or deleting an index in the cluster took ~3 seconds. All of a sudden,  
> > creating or deleting an index is taking ~30 seconds. We have looked through  
> > all the logs and can't find anything. The cluster state is ~5.5MB, which  
> > doesn't seem big enough to be prohibitive.
> 
> Standard warning that that is a lot. If possible try to squash them  
> together somehow.
> 
> That aside I have the same number of indices and feel like I get better  
> performance on created than you do. Not sure why though. I feel like my  
> mapping updates are sluggish but don't know if that is caused by the number  
> of indexes.
> 
> What part of index creation is taking 30 seconds? The rest call or the  
> actual share assignment?
> 
> > Any thoughts on why this happened and how I can debug? Any help would be  
> > greatly appreciated.
> 
> Are you getting swamped by other cluster admin actions? You should be  
> able to get information about that from the cat API. Maybe also your  
> cluster state exploded in size? Any change on CPU usage on the currently  
> elected master? Any hot threads look like admin actions? Maybe hit it  
> with jstack and look for admin actions there. They might not be hot threads  
> but maybe there are lots running at once?
> 
> Nik

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/aeda1ea8-cb67-4f34-9482-bca7240ff500%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/aeda1ea8-cb67-4f34-9482-bca7240ff500%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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: [July 6, 2017, 12:43am UTC](https://discuss.elastic.co/t/elasticsearch-index-creation-deletion-incredibly-slow/21305/4 "2017-07-06T00:43:02Z")

</div>


