# ElasticSearch hangs when trying to upload large file

**URL:** https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821
**Category:** Elasticsearch
**Created:** [December 11, 2013, 7:38pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821 "2013-12-11T19:38:04Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![Melody\_Whitaker](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@Melody\_Whitaker](https://discuss.elastic.co/u/Melody_Whitaker)
#### Post date: [December 11, 2013, 7:38pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/1 "2013-12-11T19:38:04Z")

</div>

I have an environment set up running ElasticSearch 0.90.2 with two master  
nodes (each on their own server) and 8 data nodes (two nodes on 4 servers):

- master 1 - 4 vcpus, 32 GB RAM
- master 2 - 8 vcpus, 16 GB RAM
- data 1 - 4 each have 4 vcpus and 32 GB RAM

Initially, I was using a BulkRequestBuilder api to load json files to ES  
but was having problems with the process hanging. So to isolate the  
problem, I found the largest file (438MB) and attempted to upload via the  
command line using curl. This also hung, so I tried the next largest file  
that I had which was 183MB and curl was able to post this file without any  
problems and only took about 12 minutes to complete.

The 453MB json file that I'm having trouble with contains binary data (the  
183MB file also had binary data) and the curl command I am using:

curl -XPOST  
'[http://localhost:9200/attachment.index/Attachment/1234345345345](http://localhost:9200/attachment.index/Attachment/1234345345345)' -d  
@largebinaryfile.json \> status.log

and after more than an hour, the progress meter shows:

% Total % Received % Xferd Average Speed Time  
Curr.  
Dload Upload Total Current Left  
Speed  
0 437M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--  
0\< HTTP/1.1 100 Continue } [data not shown]  
100 437M 0 0 100 437M 0 83466 1:31:41 1:31:41 --:--:--  
0

I've let this process run for more than 5 hours but it never completes and  
never errors. Any ideas why ES is hanging?

--  
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/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![mattweber](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mattweber/32/44940_2.png) [@mattweber](https://discuss.elastic.co/u/mattweber)
#### Post date: [December 11, 2013, 7:48pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/2 "2013-12-11T19:48:12Z")

</div>

Did you increase the max content length [1]? Also, I think you should be  
using "--data-binary @largebinaryfiles.json" vs the "-d" option.

Thanks,  
Matt Weber

[1]

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

On Wed, Dec 11, 2013 at 11:38 AM, mmwhita [mmwhitaker1@gmail.com](mailto:mmwhitaker1@gmail.com) wrote:

> I have an environment set up running Elasticsearch 0.90.2 with two master  
> nodes (each on their own server) and 8 data nodes (two nodes on 4 servers):
> 
> - master 1 - 4 vcpus, 32 GB RAM
> - master 2 - 8 vcpus, 16 GB RAM
> - data 1 - 4 each have 4 vcpus and 32 GB RAM
> 
> Initially, I was using a BulkRequestBuilder api to load json files to ES  
> but was having problems with the process hanging. So to isolate the  
> problem, I found the largest file (438MB) and attempted to upload via the  
> command line using curl. This also hung, so I tried the next largest file  
> that I had which was 183MB and curl was able to post this file without any  
> problems and only took about 12 minutes to complete.
> 
> The 453MB json file that I'm having trouble with contains binary data (the  
> 183MB file also had binary data) and the curl command I am using:
> 
> curl -XPOST '  
> [http://localhost:9200/attachment.index/Attachment/1234345345345](http://localhost:9200/attachment.index/Attachment/1234345345345)' -d  
> @largebinaryfile.json \> status.log
> 
> and after more than an hour, the progress meter shows:
> 
> % Total % Received % Xferd Average Speed Time  
> Curr.  
> Dload Upload Total Current Left  
> Speed  
> 0 437M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--  
> 0\< HTTP/1.1 100 Continue } [data not shown]  
> 100 437M 0 0 100 437M 0 83466 1:31:41 1:31:41 --:--:--  
> 0
> 
> I've let this process run for more than 5 hours but it never completes and  
> never errors. Any ideas why ES is hanging?
> 
> --  
> 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/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com)  
> .  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAJ3KEoCCWaS%2BELAzgmEsgydgJ8Swd6Fzxkm2J%2BrmvST\_3OzzVg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJ3KEoCCWaS%2BELAzgmEsgydgJ8Swd6Fzxkm2J%2BrmvST_3OzzVg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Melody\_Whitaker](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@Melody\_Whitaker](https://discuss.elastic.co/u/Melody_Whitaker)
#### Post date: [December 11, 2013, 7:55pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/3 "2013-12-11T19:55:57Z")

</div>

Matt,

I did increase the http.max\_content\_length when I first tried to curl this  
file because I got an error in the logs. I've also tried using the  
--data-binary switch vice -d, but had the same results.

Thx!

On Wed, Dec 11, 2013 at 2:48 PM, Matt Weber [matt.weber@gmail.com](mailto:matt.weber@gmail.com) wrote:

> Did you increase the max content length [1]? Also, I think you should be  
> using "--data-binary @largebinaryfiles.json" vs the "-d" option.
> 
> Thanks,  
> Matt Weber
> 
> [1]  
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/modules-http.html)
> 
> On Wed, Dec 11, 2013 at 11:38 AM, mmwhita [mmwhitaker1@gmail.com](mailto:mmwhitaker1@gmail.com) wrote:
> 
> > I have an environment set up running Elasticsearch 0.90.2 with two master  
> > nodes (each on their own server) and 8 data nodes (two nodes on 4 servers):
> > 
> > - master 1 - 4 vcpus, 32 GB RAM
> > - master 2 - 8 vcpus, 16 GB RAM
> > - data 1 - 4 each have 4 vcpus and 32 GB RAM
> > 
> > Initially, I was using a BulkRequestBuilder api to load json files to ES  
> > but was having problems with the process hanging. So to isolate the  
> > problem, I found the largest file (438MB) and attempted to upload via the  
> > command line using curl. This also hung, so I tried the next largest file  
> > that I had which was 183MB and curl was able to post this file without any  
> > problems and only took about 12 minutes to complete.
> > 
> > The 453MB json file that I'm having trouble with contains binary data  
> > (the 183MB file also had binary data) and the curl command I am using:
> > 
> > curl -XPOST '  
> > [http://localhost:9200/attachment.index/Attachment/1234345345345](http://localhost:9200/attachment.index/Attachment/1234345345345)' -d  
> > @largebinaryfile.json \> status.log
> > 
> > and after more than an hour, the progress meter shows:
> > 
> > % Total % Received % Xferd Average Speed Time  
> > Curr.  
> > Dload Upload Total Current Left  
> > Speed  
> > 0 437M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:--  
> > 0\< HTTP/1.1 100 Continue } [data not shown]  
> > 100 437M 0 0 100 437M 0 83466 1:31:41 1:31:41 --:--:--  
> > 0
> > 
> > I've let this process run for more than 5 hours but it never completes  
> > and never errors. Any ideas why ES is hanging?
> > 
> > --  
> > 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/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ac2d0500-8540-48ce-b0a2-23628ab01b0e%40googlegroups.com)  
> > .  
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe](https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAJ3KEoCCWaS%2BELAzgmEsgydgJ8Swd6Fzxkm2J%2BrmvST\_3OzzVg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAJ3KEoCCWaS%2BELAzgmEsgydgJ8Swd6Fzxkm2J%2BrmvST_3OzzVg%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Melody Whitaker

--  
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/CAMNNOSdbgJsFoJQ-kfC30zpzxb9Q\_tS\_T8QH657ecp9Xcz5ddg%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMNNOSdbgJsFoJQ-kfC30zpzxb9Q_tS_T8QH657ecp9Xcz5ddg%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![jprante](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jprante/32/44941_2.png) [@jprante](https://discuss.elastic.co/u/jprante)
#### Post date: [December 11, 2013, 7:56pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/4 "2013-12-11T19:56:25Z")

</div>

It looks you had tweaked the default settings, but I would upload data  
portions of 100M at most, the whole length of the upload will require  
valuable space on the heap.

Jörg

--  
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/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N\_r%2BxY-vQwaV6xeAew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N_r%2BxY-vQwaV6xeAew%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![Melody\_Whitaker](https://avatars.discourse-cdn.com/v4/letter/m/a9a28c/32.png) [@Melody\_Whitaker](https://discuss.elastic.co/u/Melody_Whitaker)
#### Post date: [December 13, 2013, 6:01pm UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/5 "2013-12-13T18:01:47Z")

</div>

I upgraded ES to 0.90.7 and it no longer hangs which is great but I get an  
out of memory error after about 7-8 minutes of processing even though i've  
allocated 14g max memory to all data nodes.

On Wed, Dec 11, 2013 at 2:56 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
[joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:

> It looks you had tweaked the default settings, but I would upload data  
> portions of 100M at most, the whole length of the upload will require  
> valuable space on the heap.
> 
> Jörg
> 
> --  
> You received this message because you are subscribed to a topic in the  
> Google Groups "elasticsearch" group.  
> To unsubscribe from this topic, visit  
> [https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe](https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe).  
> To unsubscribe from this group and all its topics, 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/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N\_r%2BxY-vQwaV6xeAew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N_r%2BxY-vQwaV6xeAew%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
Melody Whitaker

--  
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/CAMNNOSf6V%2B9ywj4T\_U%3DvQAb57Pv7H1y9etO8sdtr\_6bs\_Es9sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMNNOSf6V%2B9ywj4T_U%3DvQAb57Pv7H1y9etO8sdtr_6bs_Es9sA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)
#### Post date: [December 16, 2013, 7:45am UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/6 "2013-12-16T07:45:50Z")

</div>

Hey,

do you have a stacktrace to look at? Also, your master nodes usually dont  
need so much HEAP (it can be even counter productive, as this may lead to  
longer garbage collections due to so much memory needing to be cleaned up).

--Alex

On Fri, Dec 13, 2013 at 7:01 PM, Melody Whitaker [mmwhitaker1@gmail.com](mailto:mmwhitaker1@gmail.com)wrote:

> I upgraded ES to 0.90.7 and it no longer hangs which is great but I get an  
> out of memory error after about 7-8 minutes of processing even though i've  
> allocated 14g max memory to all data nodes.
> 
> On Wed, Dec 11, 2013 at 2:56 PM, [joergprante@gmail.com](mailto:joergprante@gmail.com) \<  
> [joergprante@gmail.com](mailto:joergprante@gmail.com)\> wrote:
> 
> > It looks you had tweaked the default settings, but I would upload data  
> > portions of 100M at most, the whole length of the upload will require  
> > valuable space on the heap.
> > 
> > Jörg
> > 
> > --  
> > You received this message because you are subscribed to a topic in the  
> > Google Groups "elasticsearch" group.  
> > To unsubscribe from this topic, visit  
> > [https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe](https://groups.google.com/d/topic/elasticsearch/gidmFCKfUZ8/unsubscribe).  
> > To unsubscribe from this group and all its topics, 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/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N\_r%2BxY-vQwaV6xeAew%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAKdsXoFy8XOuEt1SUMZOm5yWrTMkhxo9N_r%2BxY-vQwaV6xeAew%40mail.gmail.com)  
> > .
> > 
> > For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).
> 
> --  
> Melody Whitaker
> 
> --  
> 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/CAMNNOSf6V%2B9ywj4T\_U%3DvQAb57Pv7H1y9etO8sdtr\_6bs\_Es9sA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAMNNOSf6V%2B9ywj4T_U%3DvQAb57Pv7H1y9etO8sdtr_6bs_Es9sA%40mail.gmail.com)  
> .
> 
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
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/CAGCwEM89pvYVf2am56Q-Nzb-znHgkgEtozV-utxiYkkwyg2BTA%40mail.gmail.com](https://groups.google.com/d/msgid/elasticsearch/CAGCwEM89pvYVf2am56Q-Nzb-znHgkgEtozV-utxiYkkwyg2BTA%40mail.gmail.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:01am UTC](https://discuss.elastic.co/t/elasticsearch-hangs-when-trying-to-upload-large-file/14821/7 "2017-07-06T02:01:06Z")

</div>


