# Proxy without buffering

**URL:** <https://www.ruby-forum.com/t/proxy-without-buffering/226905>\
**Category:** NGINX\
**Created:** [February 25, 2013, 10:40am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905 "2013-02-25T10:40:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2013, 10:40am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/1 "2013-02-25T10:40:15Z")

</div>

Hello,

Large POST-request are buffered to disk, before passed to the backend.  
The backend has troubles to parse the POST-data, if the requests are  
huge  
(some GB).

We use “haproxy” in front of “nginx”, to workaround this issue.  
But this causes extra load on the server.  
Is there a chance to disable the request buffering?

Thanks a lot  
Markus

Posted at Nginx Forum:

> **[Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236568#msg-236568)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2013, 1:30pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/2 "2013-02-25T13:30:18Z")

</div>

On Mon, Feb 25, 2013 at 04:39:53AM -0500, double wrote:

> Hello,
> 
> Large POST-request are buffered to disk, before passed to the backend.  
> The backend has troubles to parse the POST-data, if the requests are huge  
> (some GB).
> 
> We use “haproxy” in front of “nginx”, to workaround this issue.  
> But this causes extra load on the server.  
> Is there a chance to disable the request buffering?

Yep, it’s possible, see the other active threads for a patch from  
tengine  
to implement non-buffered uploads.

Also it’d be very nice to get this feature to standard nginx,  
many people need it!

– Pasi

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 25, 2013, 1:59pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/3 "2013-02-25T13:59:31Z")

</div>

Thanks a lot!

> Also it’d be very nice to get this feature to standard nginx,  
> many people need it!

100% true.  
I hate this workaround via “haproxy”

Posted at Nginx Forum:  
[http://forum.nginx.org/read.php?2,236568,236576#msg-236576](http://forum.nginx.org/read.php?2,236568,236576#msg-236576)

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 5:03am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/4 "2013-02-27T05:03:16Z")

</div>

Hello,

I have two questions.

1. why does backend has troubles to parse request? because parsing huge  
request make heavy load?
2. why haproxy in front nginx can workaround the issue? I think nginx  
will  
still buffer the request to temp file

Thanks a lot

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236649#msg-236649)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 9:25am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/5 "2013-02-27T09:25:35Z")

</div>

Example:  
Size of POST-request: 10 GB (e.g. HD video)  
Upload-time: 4h  
The front-server proxies the request to the upload-server.  
After the upload has finished, the uploading client wants a quick “all  
fine”-message (maximum 30 seconds).

If the upload-server gets the stream directly, the machine has has 4h to  
parse the request (e.g. “upload-module” or “apache-fastcgi-module”). And  
this does not overload the system.

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236656#msg-236656)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 11:36am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/6 "2013-02-27T11:36:30Z")

</div>

Hello,

```
  thanks for your reply. but i am still confused with the workground

```

about haproxy.  
i know haproxy dose not buffer request, but if use haproxy in  
front  
of nginx,  
when haproxy pass request to nginx, nginx will still buffer the  
request to disk

Thanks a lot

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236665#msg-236665)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 6:47pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/7 "2013-02-27T18:47:54Z")

</div>

Hello,

```
  as you said, you use haproxy in front of nginx, that means the 

```

request  
will be proxied by haproxy first, and then be proxied by nginx,  
although haproxy can proxy request immediately, but nginx can not pass  
the  
request on-the-fly, it will buffer request anagin. Have i made  
some mistakes?

thanks a lot

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236695#msg-236695)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 12:26pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/8 "2013-02-27T12:26:11Z")

</div>

haproxy does not buffer the request - it proxies immediately.

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236668#msg-236668)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [February 27, 2013, 8:07pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/9 "2013-02-27T20:07:58Z")

</div>

Machine ““front-end””:  
haproxy (port 80) → proxies to “port 8080” and “machine upload”  
nginx (port 8080)

Machine “upload”:  
nginx (port 80) via “front-end”

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,236699#msg-236699)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 22, 2015, 7:43am UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/10 "2015-01-22T07:43:37Z")

</div>

Hi, all

Is there any progress in this area so far? It would be great if this  
did/will become a standard feature of nginx.

Posted at Nginx Forum:

> **[Re: Proxy without buffering](https://forum.nginx.org/read.php?2,236568,256238#msg-256238)**
>
> Hello, Large POST-request are buffered to disk, before passed to the backend. The backend has troubles to parse the POST-data, if the requests are huge (some GB). We use "haproxy" in front of "nginx", to workaround this issue. But...

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [January 26, 2015, 3:13pm UTC](https://www.ruby-forum.com/t/proxy-without-buffering/226905/11 "2015-01-26T15:13:03Z")

</div>

On Thu, Jan 22, 2015 at 01:43:10AM -0500, jamesgan wrote:

> Hi, all
> 
> Is there any progress in this area so far? It would be great if this  
> did/will become a standard feature of nginx.

+1

– Pasi
