# Slow update-mapping pending tasks

**URL:** <https://discuss.elastic.co/t/slow-update-mapping-pending-tasks/38965>\
**Category:** Elasticsearch\
**Created:** [January 12, 2016, 10:39am UTC](https://discuss.elastic.co/t/slow-update-mapping-pending-tasks/38965 "2016-01-12T10:39:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![TheDeveloper](https://avatars.discourse-cdn.com/v4/letter/t/439d5e/32.png) [@TheDeveloper](https://discuss.elastic.co/u/TheDeveloper)\
**Post date:** [January 12, 2016, 10:39am UTC](https://discuss.elastic.co/t/slow-update-mapping-pending-tasks/38965/1 "2016-01-12T10:39:41Z")

</div>

We have a multi-tenant index with a large number of mapped fields - the mapping JSON weighs in at ~47mb.

When fields are dynamically added to the mapping, the `update-mapping` pending task takes 1 minute or more to complete:

 ![](https://us1.discourse-cdn.com/elastic/original/2X/4/4f7941e6abcedfdd0d25ee737477985d77e5da71.png)

When multiple fields are dynamically mapped this can cause many queued `update-mapping` tasks as you can see in the image. The long-running tasks block other tasks and seem to be impairing performance of the cluster.

I'm aware that 2.x introduces mapping deltas which should make propagating changes more efficient. We are not yet on 2.x though. Is there anything I can do to remedy this on 1.7, short of cutting down on the number of mapped fields? Would upgrading to 2.x fix this performance bottleneck?

Also, why are the `update-mapping` tasks taking a minute or more to complete? I understand 47mb is quite large for the mapping definition but seems like it should be faster than that.

---

<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 14, 2016, 7:07am UTC](https://discuss.elastic.co/t/slow-update-mapping-pending-tasks/38965/2 "2016-01-14T07:07:15Z")

</div>

> [@TheDeveloper](#):
>
> the mapping JSON weighs in at ~47mb

That's pretty big....

> [@TheDeveloper](#):
>
> Is there anything I can do to remedy this on 1.7, short of cutting down on the number of mapped fields? Would upgrading to 2.x fix this performance bottleneck?

No and yes.

> [@TheDeveloper](#):
>
> Also, why are the update-mapping tasks taking a minute or more to complete? I understand 47mb is quite large for the mapping definition but seems like it should be faster than that.

_Every single change_ needs to send the entire changed cluster state over to each node and have it acknowledged. Cluster state is more than just the mapping, so it'll be more than 47MB.

---

<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 5, 2017, 11:24pm UTC](https://discuss.elastic.co/t/slow-update-mapping-pending-tasks/38965/3 "2017-07-05T23:24:42Z")

</div>


