> but the folder /home/admin/cachemaster fills up beyond 1gb, what am i
Could you please clarify what exactly do you observe?
Note that "max_size=" is not a strict limit, but rather a
threshold when nginx will start cleaning old cache items. It
doesn't guarantee that the size of the folder will not exceed the
limit specified - rather, nginx will take actions when the size
exceeds the limit.
Note well that with "use_temp_path=off" temporary files are placed
into the cache directory, but they will not be counted against
That is, with the specified configuration it is expected that the
folder can contain more than 1gb under load. Especially if there
are large cacheable responses in flight, which will occupy space
as temporary files.
On Tue, Dec 19, 2017 at 12:48:41PM -0500, erick3k wrote:
> what i observe is the folder cachemaster going over 1gb, way over until it
> fills the hard drive.
Please define "until it fills the hard drive". It is ok if you
have only 1gb or 2gb free, but it is certainly not ok if it fills
a free 200gb drive.
Additional question is about temporary files. As previously
explained, temporary files are not counted against the cache
max_size limit, yet will occupy space in the same folder due to
"use_temp_path=off". Consider using "use_temp_path=on" (the
default) with a proxy_temp_path pointing to a different folder to
test if the space is occupied by the cache or temporary files.
You may also want to take a look into the error log, to see if
there are any crit/alert/emerg errors. Also you may want to
check what the nginx cache manager process is doing.
> so what is the correct way to limit the cache size used by nginx?
The "proxy_cache_path ... max_size=..." is the correct way.
Though it should be understood that it doesn't limit the size of
the folder, but rather instruct nginx to remove old cache items if
the size of the cache is above the limit.