# To HTTP chunk or not to chunk

**URL:** <https://discuss.elastic.co/t/to-http-chunk-or-not-to-chunk/20768>\
**Category:** Elasticsearch\
**Created:** [November 16, 2014, 8:13pm UTC](https://discuss.elastic.co/t/to-http-chunk-or-not-to-chunk/20768 "2014-11-16T20:13:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![otisg](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/otisg/32/492_2.png) [@otisg](https://discuss.elastic.co/u/otisg)\
**Post date:** [November 16, 2014, 8:13pm UTC](https://discuss.elastic.co/t/to-http-chunk-or-not-to-chunk/20768/1 "2014-11-16T20:13:46Z")

</div>

Hi,

[http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/modules-http.html](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/modules-http.html)  
recommends NOT to use HTTP Chunking and to use Keep-Alive connections.  
Yet, the HTTP chunking link there points  
to [http://en.wikipedia.org/wiki/Chunked\_transfer\_encoding](http://en.wikipedia.org/wiki/Chunked_transfer_encoding) , which implies  
HTTP Chunking is good because it makes persistent connections possible.

Can anyone explain this apparent contradiction?

## Thanks, Otis

Monitoring \* Alerting \* Anomaly Detection \* Centralized Log Management  
Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)

--  
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/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Jurgen\_Wagner\_DVT](https://avatars.discourse-cdn.com/v4/letter/j/e0b2c6/32.png) [@Jurgen\_Wagner\_DVT](https://discuss.elastic.co/u/Jurgen_Wagner_DVT)\
**Post date:** [November 16, 2014, 9:07pm UTC](https://discuss.elastic.co/t/to-http-chunk-or-not-to-chunk/20768/2 "2014-11-16T21:07:20Z")

</div>

Hi Otis,  
Elasticsearch makes use of asynchronous HTTP in order to scale well  
with large numbers of connections. I cannot say for sure what's the  
reason for putting this caveat into the Elasticsearch docs, but chunking  
can show weird interactions with clients in an asynchronous scenario.  
This could result in interleaved streams of data returned, which creates  
extra complexity on the consumer side. While chunking clearly has  
benefits for streaming data over HTTP, I don't see much of an advantage  
with Elasticsearch where the size of responses won't be extremely large  
or unbounded (due to window sizes/paging in result sets). Keep-alive  
seems to be sufficient.

Let's see if anybody else has a better explanation... or better guess 🙂

Best regards,  
--Jürgen

On 16.11.2014 21:13, Otis Gospodnetic wrote:

> Hi,
> 
> [Elasticsearch Platform — Find real-time answers at scale | Elastic](http://www.elasticsearch.org/guide/en/elasticsearch/reference/1.4/modules-http.html)  
> recommends NOT to use HTTP Chunking and to use Keep-Alive connections.  
> Yet, the HTTP chunking link there points  
> to [Chunked transfer encoding - Wikipedia](http://en.wikipedia.org/wiki/Chunked_transfer_encoding) , which  
> implies HTTP Chunking is good because it makes persistent connections  
> possible.
> 
> Can anyone explain this apparent contradiction?
> 
> ## Thanks, Otis
> 
> Monitoring \* Alerting \* Anomaly Detection \* Centralized Log Management  
> Solr & Elasticsearch Support \* [http://sematext.com/](http://sematext.com/)
> 
> --  
> 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)  
> [mailto:elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/elasticsearch/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com)  
> [https://groups.google.com/d/msgid/elasticsearch/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/elasticsearch/1d6408e5-4bca-4239-82fd-3c3df2388efb%40googlegroups.com?utm_medium=email&utm_source=footer).  
> For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

--

Mit freundlichen Grüßen/Kind regards/Cordialement vôtre/Atentamente/С  
уважением  
_i.A. Jürgen Wagner_  
Head of Competence Center "Intelligence"  
& Senior Cloud Consultant

Devoteam GmbH, Industriestr. 3, 70565 Stuttgart, Germany  
Phone: +49 6151 868-8725, Fax: +49 711 13353-53, Mobile: +49 171 864 1543  
E-Mail: [juergen.wagner@devoteam.com](mailto:juergen.wagner@devoteam.com)  
[mailto:juergen.wagner@devoteam.com](mailto:juergen.wagner@devoteam.com), URL: [www.devoteam.de](http://www.devoteam.de)  
[http://www.devoteam.de/](http://www.devoteam.de/)

* * *

Managing Board: Jürgen Hatzipantelis (CEO)  
Address of Record: 64331 Weiterstadt, Germany; Commercial Register:  
Amtsgericht Darmstadt HRB 6450; Tax Number: DE 172 993 071

--  
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/54691208.5030404%40devoteam.com](https://groups.google.com/d/msgid/elasticsearch/54691208.5030404%40devoteam.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:49am UTC](https://discuss.elastic.co/t/to-http-chunk-or-not-to-chunk/20768/3 "2017-07-06T00:49:46Z")

</div>


