# Request Entity Too Large Exception

**URL:** <https://discuss.elastic.co/t/request-entity-too-large-exception/105987>\
**Category:** Elasticsearch\
**Created:** [November 1, 2017, 6:47am UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987 "2017-11-01T06:47:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajit](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@ajit](https://discuss.elastic.co/u/ajit)\
**Post date:** [November 1, 2017, 6:47am UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987/1 "2017-11-01T06:47:46Z")

</div>

I am getting below exception.

org.elasticsearch.client.ResponseException: PUT [http://172.21.153.176:9200/test2/jsonindextype/\_bulk:](http://172.21.153.176:9200/test2/jsonindextype/_bulk:) HTTP/1.1 413 Request Entity Too Large

I am pushing 200000 records to elasticsearch but getting above exception. Please provide suggestions.  
I want to push bulk records to elasticsearch.

---

<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:** [November 1, 2017, 7:47am UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987/2 "2017-11-01T07:47:10Z")

</div>

Send multiple smaller bulk requests, e.g. a few thousand records each. A good guideline is to try and keep the size of the bulk request below 5MB in size. This approach also has the benefit of putting your cluster under less pressure.

---

<div class="post-metadata">

**Author:** ![ajit](https://avatars.discourse-cdn.com/v4/letter/a/a3d4f5/32.png) [@ajit](https://discuss.elastic.co/u/ajit)\
**Post date:** [November 1, 2017, 1:52pm UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987/3 "2017-11-01T13:52:15Z")

</div>

Breaking data into multiple small request is taking time. Means I have 1000000 records and I am breaking data into 10 request. Per request I am sending 100000 records to elasticsearch. But It is taking time to create new json objects and sending one after another.

---

<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:** [November 1, 2017, 1:53pm UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987/4 "2017-11-01T13:53:56Z")

</div>

Have you not scripted it so you easily can alter the size of the bulk requests so you can find the optimal size?

---

<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:** [November 29, 2017, 1:57pm UTC](https://discuss.elastic.co/t/request-entity-too-large-exception/105987/5 "2017-11-29T13:57:43Z")

</div>

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