When running on the reverse proxy with Nginx, with a log format that could look like this
log_format main '$remote_addr [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$upstream_cache_status" ';
which produces logs like this
ip.addr [17/Oct/2017:10:23:53 +0100] "GET /some/path HTTP/2.0" 200 1653 "https://example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Safari/604.1.38" "HIT"
The very last bit is something I could not figure out how to configure, so I am skipping it in the moment.
log-format %h %^[%d:%t %^] "%r" %s %b "%R" "%u" "%^"
It would be useful to add statistics for $upstream_cache_status which would demonstrate the number of misses, hits, updates, and so on.
http://nginx.org/en/docs/http/ngx_http_upstream_module.html
Available status codes:
$upstream_cache_status
keeps the status of accessing a response cache (0.8.3). The status can be either “MISS”, “BYPASS”, “EXPIRED”, “STALE”, “UPDATING”, “REVALIDATED”, or “HIT”.
Are you looking to have a dedicated panel that displays this metric? or should this metric be part of an existing panel?
BTW, a quick workaround and if you are not using the virtualhost panel, you can simply use %v to display $upstream_cache_status.
Either one would do. A dedicated one would, perhaps, make it more obvious just how much the reverse-proxy offloads from back-end application servers.
@allinurl
I think adding a dedicated panel that shows this metric is very useful,
Sometimes I only need to monitor the cache hit rate.
A dedicated cache status indicator would definitely be useful for us too.
This has been implemented. Feel free to build from development to test it out, otherwise it will be pushed out in the upcoming release.
Most helpful comment
This has been implemented. Feel free to build from development to test it out, otherwise it will be pushed out in the upcoming release.