# Understanding proxy\_buffering

**URL:** <https://www.ruby-forum.com/t/understanding-proxy-buffering/238599>\
**Category:** NGINX\
**Created:** [January 19, 2014, 9:15am UTC](https://www.ruby-forum.com/t/understanding-proxy-buffering/238599 "2014-01-19T09:15:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Detlef\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/58f4c7/32.png) [@Detlef\_R](https://www.ruby-forum.com/u/Detlef_R)\
**Post date:** [January 19, 2014, 9:15am UTC](https://www.ruby-forum.com/t/understanding-proxy-buffering/238599/1 "2014-01-19T09:15:34Z")

</div>

Hi  
I’m trying to setup a reverse proxy for some private downloads. Here is  
our  
setup:  
3 Storage servers with High capacity but slow HDDs running nginx  
1 loadbalancing server with SSD and high internet uplink.  
my file sizes are several hundred megabytes (500+ up to 2GB) running  
nginx  
downloaders are on slow connections with download managers with up to 16  
connections for each file

here is what I want to do:  
a user sends a request to the SSD server, the ssd server requests the  
file  
from Slow servers and caches to response to its fast HDD and serving it  
to  
the client. But If I use the proxy\_cache , the file serving has to wait  
till  
the file has been completly transfered and cache on the SSD disk wich  
(if  
several files are requested at the same time) results in a slow  
connection  
and timeout or other errors on the client side. so this is not an  
option.

However I think proxy\_buffering is answer to my problem, I think this  
means  
each part of the requested file (defined by ranges header) is cached  
independently.

1. Am I right?  
If I’m right then
2. how can I tell the nginx, to buffer like 5mb of requested part in  
memory  
(and the excess on the SSD disk) and serve the file to the client until  
the  
client has downloaded the part and then request another 5mb?  
I’m looking for a setting like output\_buffers 1 5m; but for the proxied  
file.
3. Is there a better solution?

Regards

Posted at Nginx Forum:

> **[understanding proxy\_buffering](https://forum.nginx.org/read.php?2,246586,246586#msg-246586)**
>
> Hi I'm trying to setup a reverse proxy for some private downloads. Here is our setup: 3 Storage servers with High capacity but slow HDDs running nginx 1 loadbalancing server with SSD and high internet uplink. my file sizes are several hundred...

---

<div class="post-metadata">

**Author:** ![mojiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@mojiz](https://www.ruby-forum.com/u/mojiz)\
**Post date:** [January 19, 2014, 9:33am UTC](https://www.ruby-forum.com/t/understanding-proxy-buffering/238599/2 "2014-01-19T09:33:40Z")

</div>

Hello

One side question. Have you calculated a estimation of the expected life  
of  
a SSD disk when you are writing on it continously? I suppose that in  
such a  
situation it will die “quickly”, due to the limited number of writes  
that  
the memory can support before getting damaged.

Greetings.

Oscar

---

<div class="post-metadata">

**Author:** ![mojiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@mojiz](https://www.ruby-forum.com/u/mojiz)\
**Post date:** [January 19, 2014, 12:34pm UTC](https://www.ruby-forum.com/t/understanding-proxy-buffering/238599/3 "2014-01-19T12:34:31Z")

</div>

Hadn’t thought of that  
We could still use SAS 15K drives ,anyway even if the ssd thing works  
for a  
year or two I think the advantage will cover the cost

Posted at Nginx Forum:

> **[Re: understanding proxy\_buffering](https://forum.nginx.org/read.php?2,246586,246595#msg-246595)**
>
> Hi I'm trying to setup a reverse proxy for some private downloads. Here is our setup: 3 Storage servers with High capacity but slow HDDs running nginx 1 loadbalancing server with SSD and high internet uplink. my file sizes are several hundred...

---

<div class="post-metadata">

**Author:** ![mojiz](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/a87d85/32.png) [@mojiz](https://www.ruby-forum.com/u/mojiz)\
**Post date:** [January 19, 2014, 12:49pm UTC](https://www.ruby-forum.com/t/understanding-proxy-buffering/238599/4 "2014-01-19T12:49:39Z")

</div>

One year or two?. I think that is a very optimist estimation.  
Extrapolating the information I get from a Windows program I execute in  
my  
laptop when I install software (it is a moment where you are writing  
files  
to the disk), I suppose you should expect a very much shorter life for  
your  
SSD disk. Perhaps anyone in the list have real experience in that  
subject…
