Welcome! Log In Create A New Profile

Advanced

nginx 1.0.12 перестает кешировать

Posted by ink08 
nginx 1.0.12 перестает кешировать
February 26, 2012 08:42AM
Есть nginx 1.0.12, из stub_status видно, что в среднем 1000 соединений в секунду
в какой-то момент nginx перестает из кеша отдавать, из-за чего такое может быть?
в логе видно, что из кеша берется, а потом каждый раз обращается к апачу, из-за этого load average на сервере растет до 120.
куски конфига и логи:

http {
proxy_cache_path /mnt/storage0/cache levels=1:2 keys_zone=one:10m inactive=30m max_size=5000m;
log_format cache '[$time_local] [$status] $request_method $host $request_uri $upstream_addr $remote_addr [$request_body]';
upstream local {
server 127.0.0.1:8080;
}
...
server {
server_name domain.ru www.domain.ru domain.org www.domain.org;
...
proxy_buffering on;
proxy_buffers 256 8k;
proxy_max_temp_file_size 2048m;
proxy_cache_valid 200 301 302 304 30m;
proxy_cache_key "$request_uri";
proxy_hide_header "Set-Cookie";
proxy_ignore_headers "Cache-Control" "Expires" "Set-Cookie";
proxy_cache_use_stale error timeout invalid_header http_500 http_502 http_503 http_504;
proxy_cache one;
...
location / {
access_log /mnt/storage0/var/log/nginx/cache.log cache;
proxy_pass http://local;
proxy_redirect http://domain.ru:8080/ /;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_cache one;
}

логи:
[26/Feb/2012:12:30:41 +0400] [200] GET domain.org / - 178.177.240.231 [-]
[26/Feb/2012:12:30:42 +0400] [200] GET www.domain.ru / - 213.87.133.71 [-]
[26/Feb/2012:12:30:45 +0400] [200] GET domain.ru /?params...& - 91.79.89.50 [-]
[26/Feb/2012:12:30:51 +0400] [302] POST www.domain.ru / 127.0.0.1:8080 91.210.230.99 [token=08f2391c07a0e662af0763aa3c0c0c7d]
[26/Feb/2012:12:31:02 +0400] [302] POST www.domain.ru / 127.0.0.1:8080 95.221.52.170 [token=b4f8c3ee9472e453afd5c6cddb9b2078]
[26/Feb/2012:12:31:08 +0400] [200] GET domain.ru / 127.0.0.1:8080 46.147.203.4 [-]
[26/Feb/2012:12:31:08 +0400] [302] POST www.domain.ru / 127.0.0.1:8080 95.24.72.30 [token=a801801a2b27d0ee696fa9e93189683a]
[26/Feb/2012:12:31:10 +0400] [302] POST www.domain.ru / 127.0.0.1:8080 188.32.95.213 [token=5199da6014f9d0011591d3a131eb0436]
[26/Feb/2012:12:31:12 +0400] [200] GET domain.ru / - 83.149.9.247 [-]
[26/Feb/2012:12:31:12 +0400] [499] GET www.domain.org / 127.0.0.1:8080 95.220.246.4 [-]
[26/Feb/2012:12:31:12 +0400] [499] GET domain.org / 127.0.0.1:8080 217.78.183.246 [-]
[26/Feb/2012:12:31:14 +0400] [200] GET domain.org / 127.0.0.1:8080 91.79.155.193 [-]
[26/Feb/2012:12:31:13 +0400] [200] GET www.domain.ru / 127.0.0.1:8080 128.68.52.164 [-]
[26/Feb/2012:12:31:14 +0400] [200] GET domain.ru / 127.0.0.1:8080 93.123.138.7 [-]
[26/Feb/2012:12:31:13 +0400] [200] GET domain.ru / 127.0.0.1:8080 93.80.195.170 [-]
[26/Feb/2012:12:31:17 +0400] [499] GET domain.ru / 127.0.0.1:8080 94.247.19.159 [-]
[26/Feb/2012:12:31:15 +0400] [200] GET www.domain.ru / 127.0.0.1:8080 194.165.0.3 [-]
[26/Feb/2012:12:31:15 +0400] [499] GET www.domain.org / 127.0.0.1:8080 95.165.152.253 [-]
[26/Feb/2012:12:31:18 +0400] [200] GET domain.ru / 127.0.0.1:8080 78.36.189.109 [-]
[26/Feb/2012:12:31:17 +0400] [200] GET domain.org / 127.0.0.1:8080 95.25.190.141 [-]
[26/Feb/2012:12:31:18 +0400] [200] GET domain.ru / 127.0.0.1:8080 178.219.32.29 [-]
[26/Feb/2012:12:31:19 +0400] [499] GET www.domain.ru / 127.0.0.1:8080 188.134.40.80 [-]
[26/Feb/2012:12:31:19 +0400] [200] GET domain.org / 127.0.0.1:8080 95.84.157.109 [-]
[26/Feb/2012:12:31:20 +0400] [200] GET domain.ru / 127.0.0.1:8080 194.186.248.60 [-]
[26/Feb/2012:12:31:20 +0400] [200] GET domain.ru / 127.0.0.1:8080 178.140.160.238 [-]
[26/Feb/2012:12:31:20 +0400] [200] GET domain.org / 127.0.0.1:8080 212.44.132.21 [-]
Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 61
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready