Performance analysis with iostat, sar, Ksar, collectd, and serverstats
Generating Graphs
Collectd is thus superior to serverstats when it comes to extensibility. However, anyone wanting to display basic data quickly in a web interface will be happy with serverstats. A functional configuration of Apache is already located in the doc
directory:
/usr/share/doc/serverstats# cp examples/apache.conf /etc/apache2/sites-available/serverstats.conf # a2ensite serverstats.conf # service apache2 reload
A cron job automatically creates the rrd
data in /var/lib/serverstats/rrd
every minute:
$ ls /var/lib/serverstats/rrd/ apache_localhost.rrd cpu.rrd disk_sda.rrd load.rrd memory.rrd traffic_proc_eth0.rrd users.rrd
After the Apache configuration is activated, the graphs are available immediately in the web interface, as shown in Figure 3.
Collectd does not provide its own interface for creating graphs. However, plenty of options are available for generating graphs from rrd
data. As a web interface, collectd-web
makes a solid impression (Figure 4). The best approach is to install it directly from the Git repository (Listing 8).
Listing 8
Apache Configuration
Collectd also stores its data in the /var directory
; /var/lib/collectd/rrd
has a subdirectory for each enabled plugin. Those not wanting to set up a web server for viewing graphs on their production system can either copy the data to another system or operate collectd as a client server. The network plugin allows data transfer to a central collectd server via UDP connections.
Conclusions
The tools described in this article will help you get better performance from your systems. Once you learn the basics, you'll find many ways to put these performance tools to work.
Infos
- Block layer statistics: https://www.kernel.org/doc/Documentation/block/stat.txt
- Monitoring IO Performance using iostat and pt-diskstats: http://www.percona.com/live/mysql-conference-2014/sites/default/files/slides/PLMCE_2014_MonitoringIO_2014-03-26_am_revised.pdf
- plotiostat logs: http://olausson.de/programs/plot-linux-system-stats
- Linux performance observability: http://www.brendangregg.com/Perf/linux_observability_sar.png
- Ksar: http://sourceforge.net/projects/ksar/
« Previous 1 2 3 4
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
-
Latest Cinnamon Desktop Releases with a Bold New Look
Just in time for the holidays, the developer of the Cinnamon desktop has shipped a new release to help spice up your eggnog with new features and a new look.
-
Armbian 24.11 Released with Expanded Hardware Support
If you've been waiting for Armbian to support OrangePi 5 Max and Radxa ROCK 5B+, the wait is over.
-
SUSE Renames Several Products for Better Name Recognition
SUSE has been a very powerful player in the European market, but it knows it must branch out to gain serious traction. Will a name change do the trick?
-
ESET Discovers New Linux Malware
WolfsBane is an all-in-one malware that has hit the Linux operating system and includes a dropper, a launcher, and a backdoor.
-
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.