nginx fastcgi_cache not freeing deleted items causing excessive disk usage

b4a456fb-1402 nginx-forum at
Sun Jun 5 15:32:35 UTC 2016


I'm using nginx 1.10.0 and the nginx_fastcgi_cache option. I've noticed that
with a high amount of requests per second (I'm not sure when it occurs
exactly, but we have ~2500RPS with about 2Gbit/s of outgoing traffic
responses) there is an issue with the fastcgi_cache files not being freed.
lsof shows a huge amount of files as (deleted) but the space it not being
freed. Eventually the entire partition fills up like this.

The keys_zone and max_size are both set to 500m
The fastcgi_cache_valid is set to 1m

Even when the server is idle for a while (30+ minutes) the space is not
being freed. Obviously restarting nginx manually immediately frees the

Is this a bug or is there a setting I can use to perform some sort of
garbage collection?


Posted at Nginx Forum:,267401,267401#msg-267401

More information about the nginx mailing list