Question on Proxy_Cache_Path

Resicow resicow at
Wed Apr 22 19:28:51 MSD 2009


Will this be in the next version?

The issue is that in order to do proxy_cache obviously proxy_buffer 
needs to be on. This is bad if you set the minimum number of hits for a 
file to 10 lets say... so nginx will buffer and write the file out 10 
times, and then just throw the file away since it is not considered for 
inclusion into the cache.

This may be okay under normal circumstances... but if you have an SSD in 
the computer, you'll burn up all of your write cycles very quickly. 
Instead proxy_temp can be on a regular HDD, and then nginx can copy the 
file to the proxy_cache location on the SSD if the file is being 
included in the cache.



Igor Sysoev wrote:
> On Tue, Apr 21, 2009 at 07:10:41PM -0500, Resicow wrote:
>> Hello,
>> Have a quick question for you.
>> Is it possible for proxy_temp_path and proxy_cache_path to be on 
>> separate volumes?
>> It seems like nginx accepts this, however when I tried nginx would make 
>> the folders necessary in proxy_cache_path, but wouldn't ever copy files 
>> from the temp_path to the cache_path. When I locate the temp_path and 
>> the cache_path on the same volume, then everything works as expected.
>> This would be very helpful, is there anyway to accomplish this?
> Currently, these path must be on the same volume, because nginx just
> link() to new place without copying. However, I plan to fallback
> to copy temp file to another temporarily file on proxy_cache_path
> voulme and then link() it to permanent name. As current workaround
> you may set special proxy_temp_path for some locaitons only:
> http {
>      proxy_cache_path   /vol1/cache ...
>      proxy_temp_path    /vol2/temp;
>      server {
>          location / {
>              proxy_cache  ...
>              proxy_temp_path    /vol1/temp;

More information about the nginx mailing list