Welcome! Log In Create A New Profile

Advanced

Re: cache manager of nginx not clearing cache as expected

Igor A. Ippolitov
January 18, 2017 02:18PM
max_size is not a strict limit. It's just another watermark for cache
manager to start deleting files.
Also, there might be a difference between du and cache manager used
space estimation
(https://github.com/nginx/nginx/blob/f8a9d528df92c7634088e575e5c3d63a1d4ab8ea/src/os/unix/ngx_files.h#L188)

If your cache gains 25% excess in between of cache manager invocations,
it looks like there is too much data to cache.
You might want to split cache across several nginx instances with an
additional nginx balancer in front of them.

You may also try upgrading nginx to the latest version where cache
manager parameters were added
(http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_cache_path
, manager_files, manager_threshold, and manager_sleep).
Using those parameters and knowing your traffic pattern you can make a
better estimation of required cache size.
You can get newest nginx version from nginx repository:
http://nginx.org/en/linux_packages.html

On 18.01.2017 13:44, omkar_jadhav_20 wrote:
> I can not see any open files once i fire the command on affected servers :
> lsof -n /cache | grep deleted
> Also my question is why nginx is not limiting use of cache directory to its
> max_size , like in this case I have mentioned max_size for cache directory
> as 200G but in actual particular cache directory is crossing 200G of mark
> i.e going up by 243 G.
> Could you please exaplain why this happens and what needs to be done to
> avoid such FS full scenarios which causes all requests to go upstream due to
> lack of free space in FS.
>
> Posted at Nginx Forum: https://forum.nginx.org/read.php?2,272036,272038#msg-272038
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx


_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

cache manager of nginx not clearing cache as expected

omkar_jadhav_20 January 18, 2017 02:21AM

Re: cache manager of nginx not clearing cache as expected

Igor A. Ippolitov January 18, 2017 04:08AM

Re: cache manager of nginx not clearing cache as expected

omkar_jadhav_20 January 18, 2017 05:44AM

Re: cache manager of nginx not clearing cache as expected

Igor A. Ippolitov January 18, 2017 02:18PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 314
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready