Real-time performance monitoring with Netdata
Multimeter
What cannot be measured cannot be improved. Netdata lets you measure almost anything – at least as long as it's about the performance and health of a Linux computer.
Netdata is a real-time monitoring tool for Linux systems. You can't use Netdata to log a long history of monitored data, but if you're looking for a tool that will let you explore a snapshot of the system state from thousands of different angles, Netdata is a powerful alternative.
You can't ask Netdata for the values for yesterday or even the last hour. In fact, Netdata usually only shows you the last five minutes. However, it displays all measured values from a fast round robin memory in RAM with a resolution of one second. Netdata strives to draw as complete a picture as possible of the performance and health of a computer at the current point in time with minimal expense of computing power and I/O.
Getting Started with Netdata
Netdata is available for Linux, macOS, and FreeBSD. Linux installation is very easy. Several distributions, including Ubuntu, Debian, and openSUSE, make Netdata available in their repositories. If Netdata isn't available through your distro's repositories, you can download the source code from GitHub [1]; an installer script included with the GitHub files makes the installation easy.
Netdata runs as a systemd-managed daemon on the monitored system. By default, you can reach the Netdata browser GUI via http://localhost:1999. An SSH tunnel is useful if you want to access Netdata from another computer. Alternatively, you can run Netdata behind a proxy [2]. You can view the dashboard, which visualizes the measured values, on any other computer that can establish a network connection (Figure 1).
Netdata was originally designed to handle both data acquisition and dashboard representation; however, this approach did not integrate well with cloud environments, where virtual machines are constantly added and removed. Therefore, recent versions of Netdata can also work as a data collector only and delegate display tasks to a central Netdata instance.
Little Configuration
Most Netdata features work without configuration out of the box. The tool supports more than 5,000 metrics without any action on the part of the user, and it comes with some preset limits and preconfigured alarms. In addition to system metrics, Netdata can gather performance data on applications. For instance, Netdata supports a number of database systems, from MySQL to Oracle, plus NoSQL databases such as MongoDB, Redis, CouchDB, and Memcached, and even time-series databases such as Prometheus or Graphite.
Netdata also supports various web servers (Apache, NGINX, lighttpd, and others), mail servers (such as Dovecot, imapd, Amavis, and pop3d), name servers, print servers, time servers, VPN servers, load balancers, and storage systems, such as Ceph, Samba, or NFS. The tool recognizes container hosts (Docker, LXC), backup servers (Rsync, Bacula), and application servers such as Kafka and RabbitMQ. Netdata also supports Java applications.
Administrators can add their own applications under /etc/netdata/apps_groups.conf
. You can also define your own charts. In the configuration directory (/etc/netdata
) and its subdirectories, you will find several other documented config files that are needed to store user names and passwords for monitored applications.
In some cases, you might need to configure Netdata manually to access a specific application. For example, if you wish to monitor MySQL, you need to create a suitable user account with limited rights in the database (see the "Accessing MySQL Data" box).
Accessing MySQL Data
Netdata will need a MySQL user account to monitor MySQL. Enter the commands in Listing 1 to create the account. Then edit /etc/netdata/python.d/mysql.conf
and enter netdata as the username without password into one of the existing login templates. Finally, in /etc/netdata/charts.d.conf
, remove the comment character from the start of the following line:
mysql=force
After you restart Netdata, numerous new charts will appear for the local MySQL instance (Figure 2).
Listing 1
Creating a Netdata User
mysql> create user 'netdata'@'localhost'; mysql> grant replication client on *.* to 'netdata'@'localhost'; mysql> flush privileges;
Metrics
Netdata collects performance data for the classic resource groups CPU, disk, network, and main memory. The information available for this purpose is similar to what you get with a tool like sar
from the sysstat package, but with four major differences:
- Values are always instantaneous, although snapshots can be saved so that the period of interest does not scroll off the screen during your analysis.
- All data is visualized in real time.
In addition to absolute values, Netdata provides useful views grouped by application (Figure 3).
- The graphics are interactive. If the user moves the cursor along the time axis, the measured values are displayed in numbers to the right of the chart.
Each chart is preceded by an overview of the basic parameters in the form of level meters displaying swap memory usage, disk read and write operations, and the network, CPU, and RAM usage (Figure 4). Time series diagrams break down these values further. Also included are statistics on processes, interrupts, soft IRQs, or IPC semaphores.
Memory statistics contain charts relating to page faults or the size of the kernel memory structures. The disk statistics show the number of megabytes written and read, as well as the I/O operations per medium, and provide information on the size of the backlog (the I/O operations still outstanding).
The CPU load per core is followed by graphs for the number of interrupts and soft IRQs, again for each virtual CPU. Network statistics show information for packets and errors, individual protocols (TCP, UDP, ICMP), broadcasts, multicasts, and fragmentation (broken down by IPv4 and IPv6). Data is also available for the Netfilter firewall.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
New Linux Kernel Patch Allows Forcing a CPU Mitigation
Even when CPU mitigations can consume precious CPU cycles, it might not be a bad idea to allow users to enable them, even if your machine isn't vulnerable.
-
Red Hat Enterprise Linux 9.5 Released
Notify your friends, loved ones, and colleagues that the latest version of RHEL is available with plenty of enhancements.
-
Linux Sees Massive Performance Increase from a Single Line of Code
With one line of code, Intel was able to increase the performance of the Linux kernel by 4,000 percent.
-
Fedora KDE Approved as an Official Spin
If you prefer the Plasma desktop environment and the Fedora distribution, you're in luck because there's now an official spin that is listed on the same level as the Fedora Workstation edition.
-
New Steam Client Ups the Ante for Linux
The latest release from Steam has some pretty cool tricks up its sleeve.
-
Gnome OS Transitioning Toward a General-Purpose Distro
If you're looking for the perfectly vanilla take on the Gnome desktop, Gnome OS might be for you.
-
Fedora 41 Released with New Features
If you're a Fedora fan or just looking for a Linux distribution to help you migrate from Windows, Fedora 41 might be just the ticket.
-
AlmaLinux OS Kitten 10 Gives Power Users a Sneak Preview
If you're looking to kick the tires of AlmaLinux's upstream version, the developers have a purrfect solution.
-
Gnome 47.1 Released with a Few Fixes
The latest release of the Gnome desktop is all about fixing a few nagging issues and not about bringing new features into the mix.
-
System76 Unveils an Ampere-Powered Thelio Desktop
If you're looking for a new desktop system for developing autonomous driving and software-defined vehicle solutions. System76 has you covered.