Welcome! Log In Create A New Profile


Limiting total disk space used by cache + temp files

May 04, 2017 02:50AM

I'm trying to limit the overall disk usage for the cache + any temp files.

I have specified:
proxy_cache_path /tmp/cache max_size=50m use_temp_path=off;
proxy_max_temp_file_size 1m;

Yet, what I observe is that the temp file will grow to the full size of the file being retrieved from the upstream, ignoring the value of proxy_max_temp_file_size, and ignoring the max_size for the cache. Only after the file is brought over completely does the cache manager kick in and delete something older from the cache to bring it back in line with the 50mb limit.

For example, if I had in the cache file1 (20 MB) and file2 (20 MB), and I receive a request for file3 which is 20 MB, the total size of the /tmp/cache directory will grow to 60 MB. Only after file3 is received in its entirety will file1 be deleted bringing the size back down to 40 MB.

I don't mind setting use_temp_path=on, but in that case as well the temp file grows beyond the proxy_max_temp_file_size.

Any advice?

Subject Author Posted

Limiting total disk space used by cache + temp files

Michael Corn May 04, 2017 02:50AM

Re: Limiting total disk space used by cache + temp files

Maxim Dounin May 04, 2017 07:02AM

Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 97
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready