# Problem with instant streaming request body to backend

**URL:** <https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473>\
**Category:** NGINX\
**Created:** [January 5, 2012, 10:49am UTC](https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473 "2012-01-05T10:49:38Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [January 5, 2012, 10:49am UTC](https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473/1 "2012-01-05T10:49:38Z")

</div>

Hey,

I am developer in new startup and Nginx is important part of whole  
system. Generally it is great load balancer, has many interesting  
modules and configuration possibilities but I have one serious problem  
which I cannot solve.

Problem is that Nginx for each request collects the whole body of  
request and only after that sends request next to backend. I know that  
I can theoretically use upload module to omit that issue but we have  
got own part of code to handle uploads in way that we need (which must  
not be supported by module in load balancer). That issue is big  
problem for us because in current load balancer implementation data  
from client is unnecessarily “cached” on load balancer (load  
balancer’s hard drive in fact) and then send to backend instead of  
instant streaming from client by load balancer to backend. Main  
problem is lower performance (requirement of fast storage on load  
balancer servers) and additional requests latency, it is really  
noticeable especially for big files.

My question is: is any chance for adding feature of instant data  
streaming of request body to backend? If chance is real can we expect  
feature implementation soon? I think that it is useful functionallity  
and can be used by many Nginx users.

Tomek

---

<div class="post-metadata">

**Author:** ![Tomasz\_Roda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@Tomasz\_Roda](https://www.ruby-forum.com/u/Tomasz_Roda)\
**Post date:** [January 5, 2012, 12:54pm UTC](https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473/2 "2012-01-05T12:54:10Z")

</div>

Tomek,

On Jan 5, 2012, at 1:48 PM, Tomasz Roda wrote:

> got own part of code to handle uploads in way that we need (which must  
> streaming of request body to backend? If chance is real can we expect  
> feature implementation soon? I think that it is useful functionallity  
> and can be used by many Nginx users.

By instant data streaming do you mean generic L4/TCP load balancing or  
still some form of a L7/HTTP load balancing with additional controls for  
headers and request/response, and with efficient handling of concurrent  
connections?

What are the other roles of your nginx setup aside from load balancing  
to the backends?

---

<div class="post-metadata">

**Author:** ![Tomasz\_Roda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@Tomasz\_Roda](https://www.ruby-forum.com/u/Tomasz_Roda)\
**Post date:** [January 5, 2012, 1:28pm UTC](https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473/3 "2012-01-05T13:28:54Z")

</div>

2012/1/5 Andrew A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> > balancer servers) and additional requests latency, it is really

I mean a L7/HTTP load balancing. We need additional handling of  
requests by Nginx for HTTPS (backend applications operate on HTTP  
requests), access logging, passing requests to proper backend  
applications basing on URL, x-accel-redirect, etc.

---

<div class="post-metadata">

**Author:** ![Tomasz\_Roda](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/d07c76/32.png) [@Tomasz\_Roda](https://www.ruby-forum.com/u/Tomasz_Roda)\
**Post date:** [January 5, 2012, 1:45pm UTC](https://www.ruby-forum.com/t/problem-with-instant-streaming-request-body-to-backend/215473/4 "2012-01-05T13:45:36Z")

</div>

Tomek,

On Jan 5, 2012, at 4:27 PM, Tomasz Roda wrote:

> > > which I cannot solve.  
> > > problem is lower performance (requirement of fast storage on load  
> > > What are the other roles of your nginx setup aside from load balancing to the  
> > > backends?
> 
> I mean a L7/HTTP load balancing. We need additional handling of  
> requests by Nginx for HTTPS (backend applications operate on HTTP  
> requests), access logging, passing requests to proper backend  
> applications basing on URL, x-accel-redirect, etc.

There’s some work planned towards this direction (allowing to avoid  
buffering from the client), mostly to facilitate websockets stuff. But  
probably will turn out to be a generic “unbuffered L4/L7” load  
balancing. There’s no ETA, though and it’s probably a three months  
timeframe.
