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
-
Fedora 41 Beta Available with Some Interesting Additions
If you're a Fedora fan, you'll be excited to hear the beta version of the latest release is now available for testing and includes plenty of updates.
-
AlmaLinux Unveils New Hardware Certification Process
The AlmaLinux Hardware Certification Program run by the Certification Special Interest Group (SIG) aims to ensure seamless compatibility between AlmaLinux and a wide range of hardware configurations.
-
Wind River Introduces eLxr Pro Linux Solution
eLxr Pro offers an end-to-end Linux solution backed by expert commercial support.
-
Juno Tab 3 Launches with Ubuntu 24.04
Anyone looking for a full-blown Linux tablet need look no further. Juno has released the Tab 3.
-
New KDE Slimbook Plasma Available for Preorder
Powered by an AMD Ryzen CPU, the latest KDE Slimbook laptop is powerful enough for local AI tasks.
-
Rhino Linux Announces Latest "Quick Update"
If you prefer your Linux distribution to be of the rolling type, Rhino Linux delivers a beautiful and reliable experience.
-
Plasma Desktop Will Soon Ask for Donations
The next iteration of Plasma has reached the soft feature freeze for the 6.2 version and includes a feature that could be divisive.
-
Linux Market Share Hits New High
For the first time, the Linux market share has reached a new high for desktops, and the trend looks like it will continue.
-
LibreOffice 24.8 Delivers New Features
LibreOffice is often considered the de facto standard office suite for the Linux operating system.
-
Deepin 23 Offers Wayland Support and New AI Tool
Deepin has been considered one of the most beautiful desktop operating systems for a long time and the arrival of version 23 has bolstered that reputation.