Welcome! Log In Create A New Profile

Advanced

Re: nginx cache

Vasil Mikhalenya
April 29, 2015 05:36AM
Коллеги, подскажите что происходит

CentOS Linux release 7.1.1503 (Core)

nginx version: nginx/1.7.10

built by gcc 4.8.2 20140120 (Red Hat 4.8.2-16) (GCC)

TLS SNI support enabled

configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx
--sbin-path=/usr/sbin/nginx --conf-path=/etc/nginx/nginx.conf
--error-log-path=/var/log/nginx/error.log
--http-log-path=/var/log/nginx/access.log
--http-client-body-temp-path=/var/lib/nginx/tmp/client_body
--http-proxy-temp-path=/var/lib/nginx/tmp/proxy
--http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi
--pid-path=/var/run/nginx.pid --lock-path=/var/lock/subsys/nginx
--with-openssl=/builddir/build/BUILD/nginx-1.7.10/openssl-1.0.2a
--with-openssl-opt=enable-tlsext --with-http_secure_link_module
--with-http_random_index_module --with-http_ssl_module
--with-http_realip_module --with-http_addition_module
--with-http_sub_module --with-http_dav_module
--with-http_gzip_static_module --with-http_stub_status_module
--with-http_geoip_module --with-http_spdy_module
--with-http_auth_request_module --with-debug --with-file-aio
--with-cc-opt='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions
-fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches
-m64 -mtune=generic'
--add-module=/builddir/build/BUILD/nginx-1.7.10/ngx_devel_kit-0.2.19
--add-module=/builddir/build/BUILD/nginx-1.7.10/nginx_accept_language_module
--add-module=/builddir/build/BUILD/nginx-1.7.10/lua-nginx-module-0.9.12
--add-module=/builddir/build/BUILD/nginx-1.7.10/nginx-dav-ext-module
--add-module=/builddir/build/BUILD/nginx-1.7.10/naxsi-0.53-2/naxsi_src
--add-module=/builddir/build/BUILD/nginx-1.7.10/ngx_http_redis-0.3.7
--add-module=/builddir/build/BUILD/nginx-1.7.10/echo-nginx-module-0.56


proxy_cache_path /var/lib/nginx/cache keys_zone=mycdn:20m inactive=1d
use_temp_path=off;


server {

listen 80;

server_name mycdn.com 127.0.0.1;


proxy_cache mycdn;


location / {

proxy_pass http://origin;

proxy_set_header Host $proxy_host;

proxy_cache_lock on;

proxy_cache_lock_age 2h;

proxy_cache_lock_timeout 2h;

proxy_cache_key "$uri";

add_header Cache $upstream_cache_status;

}

}


[root@node ~]# ll /var/lib/nginx/cache/ | wc -l

228
т.е. у nginx в cache есть около 2 сотен популярных файлов (118G
/var/lib/nginx/cache/),
он успешно отдает несколько дней, ничего нового из origin не качает, в
какой то момент случается это

[root@node ~]# ll /var/lib/nginx/cache/temp/ | wc -l

5714

Т.е. число файлов в temp растет очень быстро, хотя обычно = 0.

restart nginx и очистка tempdir не помогает (файлы в tempdir появляются
снова), помогает только полная очистка cache

Пользователи делают запросы с range.




2015-04-17 2:27 GMT+03:00 Валентин Бартенев <vbart@nginx.com>:

> On Thursday 16 April 2015 17:48:20 Vasil Mikhalenya wrote:
> > возможно ли ограничить количество одновременно загружаемых файлов с
> > апстрима?
> >
> [..]
>
> http://nginx.org/ru/docs/http/ngx_http_limit_conn_module.html
>
> --
> Валентин Бартенев
> _______________________________________________
> nginx-ru mailing list
> nginx-ru@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-ru




--
Best regards,
Vasil Mikhalenya
_______________________________________________
nginx-ru mailing list
nginx-ru@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-ru
Subject Author Posted

nginx cache

Vasil Mikhalenya April 16, 2015 05:28AM

Re: nginx cache

Vasil Mikhalenya April 16, 2015 05:42AM

Re: nginx cache

Vasil Mikhalenya April 16, 2015 11:50AM

Re: nginx cache

Валентин Бартенев April 16, 2015 07:28PM

Re: nginx cache

Vasil Mikhalenya April 29, 2015 05:36AM

Re: nginx cache

Maxim Dounin April 29, 2015 07:20AM

Re: nginx cache

Vasil Mikhalenya April 30, 2015 07:06AM

Re: nginx cache

Vasil Mikhalenya February 12, 2016 10:40AM

Re: nginx cache

Vasil Mikhalenya February 12, 2016 11:18AM

Re: nginx cache

Maxim Dounin February 12, 2016 09:18PM

Re: nginx cache

Vasil Mikhalenya February 14, 2016 06:36AM

Re: nginx cache

Vasil Mikhalenya February 29, 2016 07:46AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 110
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready