How to make nginx fail if it can't write to cache dir.

Reinis Rozitis r at roze.lv
Thu Jan 27 11:39:54 UTC 2022


> Cache config:
> proxy_cache_path /nginx/cache levels=1:2 keys_zone=bla:20m max_size=10g
inactive=20m use_temp_path=off;
> 
> I had a problem while using tmpfs mount for nginx cache dir, my automation
mounted it over and over again(so each time nginx created a new set of base
dirs [a-z]), but after a few mounts, it could no longer create new base
dirs(no more memory) and writes to the cache dir failed with:


Isn't it something to fix on the automation/mount side rather than trying
nginx to "fail"?

If there is lack of resources maybe lowering the max_size=10g also would
make sense.

rr
 



More information about the nginx mailing list