Monitor Nginx Real-time Metrics on Linux/Ubuntu

Monitoring the net server is important to see what is occurring in your web site. Currently I used to be searching for an answer and got here throughout this one ngxtop, which lets you monitor varied metrics, together with the next.

  • Present lively request
  • Abstract of the whole variety of requests
  • Whole request per standing code (2xx, 3xx, 4xx, 5xx)
  • Common byte despatched
  • High distant deal with

On this article I clarify the right way to set up and use it ngxtop for Linux and Ubuntu OS.

Beforehand, I used GoAccess Log Analyzer and located that ngxtop is a light-weight and sensible choice for monitoring Nginx internet server statistics.

This assumes Nginx is put in and operating. If not, you possibly can seek advice from my set up information.

A bit of introduction about ngxtop

ngxtop is a Python primarily based program, which you’ll be able to set up on high of Python. As soon as put in, you possibly can run ngxtop and you’ll discover that it resembles the everyday high output on Linux, however with Nginx associated info.

To put in ngxtop on CentOS/RHEL

First you could set up PIP (Python Package deal Administration System).

To do that…

  • Login to your server with root credential
  • Allow EPEL repository by putting in under package deal
yum set up epel-release

Set up now Pip with the command under

yum set up python-pip

And eventually, use under to put in ngxtop

pip set up ngxtop

In case you are utilizing CentOS/RHEL 8, you should utilize the DNF command as follows.

dnf set up epel-release python2 python2-pip
pip2 set up ngxtop

To put in ngxtop on Ubuntu

Use the command under to put in PIP

apt-get set up python-pip

And now use the next to put in ngxtop

pip set up ngxtop

set up is easy. Is it not? Let’s take a look at some real-time statistics.

Abstract of Nginx actions

Utilization ngxtop command to view the abstract of the variety of requests, the requested URI, and the variety of requests by standing code.

ngxtop

Tip: you should utilize to discover a damaged hyperlink by taking a look at a request, which has a standing code like 404.

Test the IP deal with of the highest consumer

It is rather helpful to see who’s making a variety of requests to your Nginx server.

ngxtop high remote_addr

ngxtop remote addr

How about displaying solely requests which have a 404 standing code?

ngxtop -i 'standing >= 404'

Not solely is it real-time, however it’s also possible to analyze it offline by parsing the entry log.

To research entry.log you should utilize:

ngxtop –l /path/entry.log

One other instance is parsing Apache’s offline entry.log.

ngxtop –f frequent –l /path/entry.log

There are a number of combos you should utilize to filter out entry.log for significant information. Subsequent, it’s possible you’ll need to check out Nginx Plus.

Leave a Comment

porno izle altyazılı porno porno