Docs » Integrations Guide » Integrations Reference » NGINX

image0 NGINX

Metadata associated with the NGINX collectd plugin can be found here. The relevant code for the plugin can be found here.

DESCRIPTION

Use the NGINX plugin for collectd to monitor NGINX webserver performance.

FEATURES

Built-in dashboards

  • NGINX Servers: Overview of data from all NGINX servers.

image1

  • NGINX Server: Focus on a single NGINX server.

image2

REQUIREMENTS AND DEPENDENCIES

This plugin requires:

Software Version
collectd 4.2+

INSTALLATION

If you are using the new Smart Agent, see the docs for thecollectd/nginxmonitor for more information. The configuration documentation below may be helpful as well, but consult the Smart Agent repo’s docs for the exact schema.

  1. Installing the plugin:

    • On RHEL/CentOS and Amazon Linux systems, run the following command to install this plugin:

      yum install collectd-nginx
      
    • On Ubuntu and Debian systems, this plugin is included by default with the SignalFx collectd agent.

  2. Enable the stub_status module in your NGINX server as described below.

  3. Download SignalFxs sample configuration file to /etc/collectd/managed_config.

  4. Modify the sample configuration file to provide values that make sense for your environment, as described in Configuration, below.

  5. Restart collectd.

CONFIGURATION

Using the example configuration file 10-nginx.conf as a guide, provide values for the configuration options listed below that make sense for your environment and allow you to connect to the NGINX instance to be monitored.

configuration option definition default value
URL URL at which collectd can access the output of the NGINX status module. http://localhost:80/nginx_status

NGINX service configuration

Please see nginxdocs for a guide to configuring the NGINX stats module ngx_http_stub_status_module.

USAGE

Sample of built-in dashboard in SignalFx:

image3

METRICS

The following status information is provided:

Metric definition
Active connections The current number of active client connections including Waiting connections.
accepts The total number of accepted client connections.
handled The total number of handled connections. Generally, the parameter value is the same as accepts unless some resource limits have been reached (for example, the worker_connections limit).
requests The total number of client requests.
Reading The current number of connections where nginx is reading the request header.
Writing The current number of connections where nginx is writing the response back to the client.
Waiting The current number of idle client connections waiting for a request.

Below is a list of all metrics.

Metric Name Brief Type
connections.accepted Connections accepted by Nginx Web Server cumulative counter
connections.handled Connections handled by Nginx Web Server cumulative counter
nginx_connections.active Connections active in Nginx Web Server gauge
nginx_connections.reading Connections being read by Nginx Web Server gauge
nginx_connections.waiting Connections waited on by Nginx Web Server gauge
nginx_connections.writing Connections being written by Nginx Web Server gauge
nginx_requests Requests handled by Nginx Web Server cumulative counter

connections.accepted

cumulative counter

How many connections have been accepted by Nginx

Connections that have been accepted may not necessarily be handled yet.

connections.handled

cumulative counter

How many connections have been handled by Nginx

Compare to nginx_connections.accepted.

nginx_connections.active

gauge

How many connections are active in Nginx

This metric is useful to know how many connections are being actively served by Nginx.

nginx_connections.reading

gauge

How many connections are being read in Nginx

This metric shows how many connections are still in the “request” stage: the server has not fully read the request headers yet.

nginx_connections.waiting

gauge

How many connections are being waited on by Nginx

This metric shows how many connections are being waited on by Nginx. Usually they are waited on for a fixed time interval, in order that Nginx can serve a subsequent request on the same connection.

nginx_connections.writing

gauge

How many connections are being written by Nginx

This metric shows how many connections are being written by Nginx, as part of server response.

nginx_requests

cumulative counter

How many requests are being handled by Nginx

This metric shows how many requests are being handled by Nginx. More than one request can come on the same connection.