kofpet 发表于 2014-01-01 21:11

nginx_cahce缓存应用

本帖最后由 kofpet 于 2014-01-01 21:13 编辑

大家好,最近上线一批图片存储机器,由于访问量比较大,因此在图片服务前端上了两台cache,采用的是nginx_cache,但是有一个疑问请教一下大家,我服务器硬盘是ssd 250G的,总是缓存到60G左右,没法缓存更多的图片,
例如第一天缓存到90G的,第二天上去看又变成了50G左右了,导致回源量非常大,这是怎么回事?
配置如下:
    proxy_temp_path   /diskb/temp;
      proxy_cache_path    /diskb/cache levels=1:2 keys_zone=cache_one:2048m inactive=90d max_size=200G;

      location/img/ {
                proxy_next_upstream http_502 http_504 error timeout invalid_header;
                proxy_cache cache_one;
                proxy_cache_key $uri;
                proxy_set_header Host$host;
                proxy_set_header X-Forwarded-For$remote_addr;
                proxy_pass   http://xxxx;
               expires 3M;

      }

wenhq 发表于 2014-01-01 23:15

看日志看看是否有expire cache?

aaaaaa 发表于 2014-01-02 00:19

nginx处理大规模小图片cache,效果比不上ATS吧?建议上ATS

kofpet 发表于 2014-01-03 14:20

找到原因了,原来是levels设置的太小了。目录数不够。

kofpet 发表于 2014-01-03 14:23

ats了解过,不太合适我现在的公司业务,我现在都是采用nginx+lua才能完成整体的需求。
页: [1]
查看完整版本: nginx_cahce缓存应用