I am running an Nginx server to serve video content to users. This nginx server picks content from an upstream server, caches it, also serves to users. All future requests are served from this cache. I have set aside 500GB of space on cache for this. When the cache is full, the nginx cache manager is able to delete old, unused files as per my proxy_cache directive if the cache folder is on the hard drive. When I mount this cache folder on the RAM (tmpfs), nginx is unable to drop the old files. I get an error saying '28: No space left on device'. I have checked the permission of the cached folder both while on the RAM and on the hard drive. It has the same permissions.
proxy_cache_path /cache/12054 keys_zone=a12054:100m levels=1:2 max_size=500g inactive=7d;
If I unmount from RAM it starts working fine again.