-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Research option to replace Milliseconds with a Nginx module #5
Comments
Stats could be shown by previous minute? And the previous minute value would update once in a minute and that value would be fetched and stored in monitoring (and alterting). Internally it naturally also needs to know about the ongoing minute, but the value is not shown externally until the minute is full and the value is comparable with the previous value. |
A note from phone conversation that happened today: Do a time and risk estimation first. |
Did some proof-of-concept testing:
All in all, nginx-stat-module seems promising but it needs some modifications for calculating statistics. It exports a simple textual timeseries format:
nginx-stat-module sends these statistics out with udp to a configured server. This server should be on the localhost for maximum reliability. UDP can be a problem when the server is overloaded (monitoring should be the last thing that fails) but perhaps unlikely. Some reliability might be won by remembering a short period of statistics (needs code change) and sending the stats over a local unix/tcp socket (needs a code change). |
Such an architecture would create excess services for us to maintain. I was under the impression that Nginx has some simple stats module one can simply query using HTTP and dump to a file or something. |
Status:
|
…ugin Statistics are fetched once per minute from VTS. The system assumes a modified VTS that is hosted at https://github.com/Seravo/nginx-module-vts. vtsaggregator.py produces milliseconds-like output by aggregating statistics from the module. Notes: * vtsaggregator.py ignores 503 status code in 5xx aggregation (a milliseconds policy). Related #5
…ugin Statistics are fetched once per minute from VTS. The system assumes a modified VTS that is hosted at https://github.com/Seravo/nginx-module-vts. vtsaggregator.py produces milliseconds-like output by aggregating statistics from the module. Notes: * vtsaggregator.py ignores 503 status code in 5xx aggregation (a milliseconds policy). Related #5
…ugin Statistics are fetched once per minute from VTS. The system assumes a modified VTS that is hosted at https://github.com/Seravo/nginx-module-vts. vtsaggregator.py produces milliseconds-like output by aggregating statistics from the module. Notes: * vtsaggregator.py ignores 503 status code in 5xx aggregation (a milliseconds policy). Related #5
Milliseconds is based on parsing Nginx access logs to print out statistics from them. The main downside in this approach is that the access log must be written before it can be parsed, and the time frame must be decided in advance.
An alternative approach would be to extend some existing Nginx stats module stub to do these same stats on the fly with Nginx internal counters, and server them on-demand from some Nginx stats module endpoint (or dump to file when asked to). This way the stats would be as real-time as we want and without the overhead of dumping lots of lines in a log and then reading it again to compute stats.
We could perhaps fork the module http://nginx.org/en/docs/http/ngx_http_stub_status_module.html and extend it, or research if some similar module for Nginx already exists (such as https://github.com/vozlt/nginx-module-vts or https://github.com/dedok/nginx-stat-module)
The text was updated successfully, but these errors were encountered: