proxy_cache overflows max_size

stout nginx-forum at forum.nginx.org
Tue Feb 13 09:55:27 UTC 2018


Hi,

I have:
nginx version: nginx/1.12.2 (github.com/istenrot/centos-nginx-http2:
openssl-1.0.2m, PCRE JIT, PushStream, HeadersMore, LUA, Brotli)
built by gcc 4.9.2 20150212 (Red Hat 4.9.2-6) (GCC) 
working as reverse proxy for ceph with media files

Here's my configuration.. (only the relevant part)

http {

  proxy_temp_path       /mnt/nginx-cache/temp_proxy 1 2;

  proxy_cache_lock         on;
  proxy_cache_path         /mnt/nginx-cache/ceph levels=1:2
keys_zone=myCache:256m inactive=8h max_size=30g;
  proxy_cache_revalidate   on;

  proxy_request_buffering off;
  proxy_buffering on;
  proxy_buffers        64 16k; #for lua

  sendfile on;
  sendfile_max_chunk 512k;
  aio threads;
  directio 512k;
  output_buffers 1 128k;

    server {
        listen       80;
        server_name  _;

        location / {
	    proxy_pass http://ceph$uri;
            proxy_set_header Host $host;  
            proxy_cache            myCache;
        }
    }

cache is tmpfs:
tmpfs /mnt/nginx-cache tmpfs
rw,size=40960m,noatime,uid=335,context="system_u:object_r:httpd_tmp_t:s0" 0
2


Now df -h shows: tmpfs  40G   35G  5.7G  86% /mnt/nginx-cache and deleted
files in /mnt/nginx-cache/temp_proxy are about 200M

Strace of cache manager shows:
epoll_wait(9, [], 512, 1000)            = 0
epoll_wait(9, [], 512, 1000)            = 0
epoll_wait(9, [], 512, 1000)            = 0
epoll_wait(9, [], 512, 1000)            = 0
for most of the time 

How to improve this situation?

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,278534,278534#msg-278534



More information about the nginx mailing list