Notice: Undefined index: order_next_posts in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 194

Notice: Undefined index: post_link_target in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 195

Notice: Undefined index: posts_featured_size in /nas/content/live/gadgetmag/wp-content/plugins/smart-scroll-posts/smart-scroll-posts.php on line 196

Create a graph of your system’s performance

Use Dstat and Gnuplot to monitor performance, then turn that information into neat-looking graphs that anyone, even your manager, can understand...

Sukrit Dhandhania
Sukrit Dhandhania

Sukrit has spent over seven years working with GNU/Linux servers, during which he set up and managed a number of  database and web servers, running live production environments

Dstat version 0.6 or better

Dstat is a versatile replacement for vmstat, iostat, netstat, nfsstat and ifstat
Gnuplot is an open source graph building application

Use Dstat and Gnuplot to monitor performance, then turn that information into neat-looking graphs that anyone, even your manager, can understand…

If you have a server which is being used to host a website or to run a web application, it helps to know what kind of load it is handling. This information is particularly useful when you start finding the website or application to be running slower than usual. You can run a check on the performance of the system and compare it with prior results to see the increase in load. Then you can take the necessary action to fix the problem. To gather the performance data of your computer you need to set up system monitoring software on the server and let it gather information which will give you an idea of the performance of the server.

Technical people can often interpret the numbers that a monitoring tool would generate, but a lot of people in upper management might not find it so easy and would relate more easily to information presented to them in the form of graphs. If you need to upgrade your server, you often need to make a case for it to the management of your organisation. You need to present the performance data to them in a form that they can relate to – fancy-looking graphs. In this article we’ll look at how to gather this monitoring information and then how to convert this data into neat graphs.

Introducing Dstat
Dstat is an open source system monitoring tool for Linux. For users familiar with vmstat, iostat, netstat, and ifstat, you can think of Dstat as a single tool that combines all their features, and offers some more. It’s a very versatile application for both system administrators and developers because it comes with the ability to save its output as comma-separated values (CSV) files, making it very easy for you to plot a graph of the system’s performance. You can include these graphs into reports or use them to convince the management to allow you to upgrade your  servers. Monitoring your server and generating performance graphs can be quite useful when assessing a server’s ability to handle load with a load generation tool. Let us now see how to setup Dstat on your Linux computer, then we’ll move on to the basic usage of Dstat.

Dstat setup
The Dstat installation process will depend on the flavour of Linux that you use. You can find binaries for various distributions on the Dstat website. Distributions such as Fedora and Ubuntu have a pretty smart package management system which will download and install the package for you. Just make sure you get Dstat version 0.6 or better installed, as there are some features that we will need that are only available in these versions.

If you are on Fedora Linux and have YUM installed and configured, you can use that to install Dstat:
# yum install dstat
If not, you can download the RPM file for your version of Fedora and install it:
# rpm -Uvh dstat-0.6.4-1.fc3.rf.noarch.rpm
Red Hat Linux users can either use up2date to install Dstat:
# up2date install dstat
Or they can use the RPM available for download:
# rpm -Uvh dstat-0.6.7-1.el5.rf.noarch.rpm
Ubuntu Linux users can use their package manager to get Dstat:
# apt-get install dstat ()