What is NGINX?NGINX (pronounced “engine X”) is a popular HTTP server and reverse proxy server. As an HTTP server, NGINX serves static content very efficiently and reliably, using relatively little memory. As a reverse proxy, it can be used as a single, controlled point of access for multiple back-end servers or for additional applications such as caching and load balancing.
NGINX dashboard overviewAs soon as you integrate NGINX with Datadog, you will have access to all the metrics NGINX exposes about client connections and request processing, plus all the system metrics (CPU, memory, I/O, etc.) from your NGINX servers. Your metrics will automatically populate an out-of-the-box NGINX dashboard in your Datadog account called “NGINX - Overview”.
Here’s a widget-by-widget breakdown of the graphs and query values in this dashboard.
Overall requests per secondThis timeseries graph aggregates the total request rate across all your NGINX servers for a high-level view of server throughput. Monitoring this metric can alert you to spikes in incoming web traffic, whether legitimate or nefarious, or sudden drops, which are usually indicative of problems. A drastic change in requests per second can alert you to problems brewing somewhere in your environment, even if it cannot tell you exactly where those problems lie.
Requests per second by hostThis host map gathers all your individual NGINX servers in one place and color-codes them by requests per second (green for low req/s, orange for high req/s). The host map allows you to identify hotspots in your web infrastructure—if one subset of servers is processing an undue amount of requests, those servers will stand out in the host map view.
Requests: reading, writing, waitingThis timeseries graph tracks metrics about the flow of requests through NGINX in the context of active client connections. When a request is received, the request is counted as Reading while NGINX reads the client request header. Request headers are lightweight, so this is usually a short-lived state, and the value of the Reading metric should be very small. After the request is read, it is counted as Writing, and remains in that state until a response is returned to the client. Because Writing includes the time that NGINX is waiting for results from upstream systems, requests will often spend the majority of their time in the Writing state. Therefore, this metric usually dominates the graph. Waiting indicates an active connection that currently has no active client request being processed.
Dropped connections countersThese two counters track high-water marks for the dropped connection rate over the past 15 minutes and over the past day, respectively. A dropped connection means that NGINX could not establish a new connection or reuse an existing one; this often indicates that a resource limit, such as NGINX’s worker_connections limit, has been reached. Under normal circumstances, dropped connections should be zero.
Dropped connections per secondThis timeseries graph tracks the dropped connection rate over the past hour. This allows you to determine at a glance whether any dropped connections were the result of a short-lived anomaly or are instead the sign of a serious problem. Because virtually any dropped connections are cause for concern, the graph is configured to show any rate greater than one dropped connection per second as an error (red).
Active connections per secondOnce NGINX successfully handles a connection, the connection moves to an active state, where it remains as client requests are processed. In protocols where a connection supports only one connection at a time, this metric is the sum of Reading requests, Writing requests, and Waiting connections.
If you’d like to see this dashboard for your NGINX metrics, you can try Datadog for free for 14 days. This dashboard will be populated immediately after you set up the NGINX integration.For a deep dive on NGINX metrics and how to monitor them, check out our three-part How to Monitor NGINX series.