Comments (8)
Please let me know nginx configuration and version to reproduce the situation.
from nginx-module-vts.
Currently we're seeing it on 1.9.4
, 1.9.6
and 1.9.7
, but I believe we were seeing it on previous versions as well (although it seems to come and go).
Our configuration is a bit complex, here is the current setup:
./configure --user=nginx --group=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 --pid-path=/var/run/nginx.pid \
--add-module=/root/nginx-tmp/lua-nginx-module-0.9.16 --with-select_module --with-poll_module --with-file-aio \
--with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module \
--with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module \
--with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module \
--with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module \
--with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-mail \
--with-mail_ssl_module --with-cpp_test_module --with-cpu-opt=CPU --with-pcre --with-pcre-jit --with-md5-asm \
--with-sha1-asm --with-zlib-asm=CPU --with-libatomic --with-debug --with-ld-opt="-Wl,-E,-rpath,/usr/local/lib" \
--add-module=/root/nginx-tmp/ngx_devel_kit-0.2.19/ --add-module=/root/nginx-tmp/nginx-rtmp-module-1.1.7/ \
--add-module=/root/nginx-tmp/form-input-nginx-module-0.11/ --add-module=/root/nginx-tmp/nginx-module-vts-0.1.2/ \
--add-module=/root/nginx-tmp/graphite-nginx-module-1.0.4 --add-module=/root/nginx-tmp/headers-more-nginx-module-0.26/
from nginx-module-vts.
Sorry, Please let me know nginx.conf :)
from nginx-module-vts.
Ha, whoops, here's what we have (this is just the relevant snippets). I removed some of the graphite data, but left a lot of the other data there.
Looking at this again, it appears maybe it's an issue with the cache name being a variable (nginx seems to handle this correctly internally from our testing -- i.e. the correct cache gets used).
proxy_cache_path /var/lib/nginx/cache/search keys_zone=search:1000m max_size=10g inactive=30d loader_files=1000 levels=1:2;
proxy_cache_path /var/lib/nginx/cache/search_live keys_zone=search_live:1000m max_size=10g inactive=1d loader_files=1000 levels=1:2;
location ^~ /search/ {
set $cache_name 'search_live';
access_by_lua '
ngx.req.read_body();
local request_body = json.decode(ngx.req.get_body_data());
if (request_body.sourceId and request_body.sourceId ~= "live") then
ngx.var.cache_name = "search"
end
';
# Removed some graphite module sends here.
proxy_pass http://search_service/search/;
# Enable caching, set the cache zone.
# We use separate cache blocks here in order to easily dump just the live (dashboard ones).
proxy_cache $cache_name;
# Build the cache based on headers, request, and host.
proxy_cache_key "search--$host$request_uri--$request_body";
proxy_cache_bypass $bypass_cache;
proxy_no_cache $no_cache;
# Only cache POSTS that are 200
proxy_cache_methods POST;
# We default to no cache here, X-Accel-Expires will be passed back by the search server
# overriding this.
proxy_cache_valid 200 5d;
proxy_cache_valid any 0m;
# Use the cache if the cache is currently being updated (prevent dogpile)
# or if the server returns 5XX (better stale than broken).
proxy_cache_use_stale updating http_500 http_502 http_503 http_504;
proxy_cache_lock on;
proxy_cache_lock_timeout 5m;
proxy_cache_lock_age 1m;
add_header X-Cached $upstream_cache_status;
}
from nginx-module-vts.
Thanks for the report.
I have confirmed that issue and it sloved in the new version which will commit soon.
I will commit fixed code soon.
from nginx-module-vts.
Awesome, thank you very much!
from nginx-module-vts.
I have a commit now.
Please check it whether it solved.
It need deeper and many review by peoples because of it changed many routine. :)
latest commit: e12984d
from nginx-module-vts.
Just loaded it up on our development machines, so far it looks like the caches are reporting correctly now, will let you know if we run into any issues. Thanks again.
from nginx-module-vts.
Related Issues (20)
- Question about nginx_vts_upstream_requests_total metric HOT 1
- Sorting HOT 1
- Change defoult sorting. HOT 1
- buffer size may be too small HOT 2
- Release a new version HOT 2
- No such file or directoryodule-vts/config: line 2: auto/have HOT 2
- Label metrics with jsonrpc method HOT 16
- the status of server is not current when max_fails = 0 HOT 4
- /status/format/json not served after clean installation HOT 1
- VTS doesn't support query string encoding HOT 1
- I encountered the following Syntax error while compiling the vts source code in windows environment HOT 2
- [emerg] 1#1: module "/etc/nginx/modules/ngx_http_vhost_traffic_status_module.so" version 1022001 instead of 1025002 in /etc/nginx/nginx.conf:5 HOT 1
- periodic cleanup of shared memory? HOT 2
- Evaluate using Profile-Guided Optimization (PGO) and Post-Link Optimization (PLO) on VTS HOT 3
- Question - time window of statistics HOT 1
- Module bug HOT 4
- Will the request fail? 'ngx_slab_alloc() failed: no memory in vhost_traffic_status_zone' HOT 1
- 2024 Can this tool support TCP monitor? HOT 1
- shm_add_upstream error HOT 1
- how to disable upstream statistics collection? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-module-vts.