I'm experiencing a really weird issue where nginx is leaking memory up until the point where it consumes all available memory on the machine and stops responding to HTTP requests.
The machine has 2GB of RAM and it only takes a few minutes for nginx to consume it all. I've also noticed the
/var/cache/nginx/tmp directory ballooning in size in line with the memory usage.
My config file includes the following. Please let me know if I need to post more information.
proxy_cache_path /var/cache/nginx/files levels=1:2 keys_zone=files:100m inactive=12h max_size=100m; proxy_cache_path /var/cache/nginx/cdn levels=1:2 keys_zone=cdn:100m inactive=12h max_size=100m; proxy_temp_path /var/cache/nginx/tmp; # in a location block: proxy_pass http://some.upstream.server/; proxy_cache files; proxy_cache_valid 200 302 24h; proxy_cache_valid 404 30s; proxy_intercept_errors on;
The server is running Ubuntu Server 11.04, with nginx 1.0.5 compiled from source.