Add caveat to README and code

This commit is contained in:
cn 2018-11-23 21:15:41 +01:00
parent 6db7f62c1d
commit a998089b92
2 changed files with 4 additions and 1 deletions

View File

@ -26,10 +26,12 @@ Successfully tested with:
## Caveats
A short metric submission interval might cause blocking on the Nginx worker threads since the shared dictionary storing all counters has to be locked.
A short metric submission interval might cause blocking on the Nginx workers since the shared dictionary storing all counters has to be locked.
Intermittent network errors while communicating with Graphite might leed to permanent loss of metric information. The communication happens in clear text and thus needs a secure separate network or other means.
If the Nginx worker elected (on Nginx startup) to run the submission loop is killed or dies no further metrics will be send until a restart.
## Install
* Install `nginx-extra` (includes Lua support) on Debian Jessie and Debian Stretch

View File

@ -67,6 +67,7 @@ end
function MetricsGraphite:worker()
-- determine which worker should handle the main loop, relies on the atomicity of ngx.shared.DICT:incr
-- see https://github.com/openresty/lua-nginx-module#ngxshareddict
-- caveeat: if the main loop worker dies no further metrics will be sent!
if self.stats:incr("main_loop_worker", 1) ~= 1 then
return
end