Quantcast
Channel: Nginx Forum - How to...
Viewing all articles
Browse latest Browse all 4759

Re: Monitor connections

$
0
0
I've just finished a fairly deep-dive into the subject of monitoring various Nginx-related things, and perhaps can be of some help --

There are basically two ways to get good monitoring data out of Nginx "free":

1) You can setup ngx_http_stub_status_module (http://nginx.org/en/docs/http/ngx_http_stub_status_module.html) and poll the output of that
2) You can log specific variables that relate to what you want to monitor and do calculations / analysis on the log files themselves.

If you elaborate a bit on the "etc" part of what stats you want, I can try to point you in the right direction. Total Active Users is a bit tough because the concept of a "user" is a bit murky -- but you can certainly look at connections and do some interpolation based on IP address, etc. Take a peek in particular at $connection (which assigns a serial number of each connection in a log entry) and the $server_addr / $server_name log variables.

PS - If you're interested, you can see the full piece I wrote here:

https://www.scalyr.com/community/guides/how-to-monitor-nginx-the-essential-guide

--Noah

Viewing all articles
Browse latest Browse all 4759

Trending Articles