Official website for Linux User & Developer

Create a graph of your system’s performance

Posted by Russell Barnes

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

Sukrit DhandhaniaAdvisor:
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 ()

Pages: 1 2 3 4
  • Tell a Friend
  • Follow our Twitter to find out about all the latest Linux news, reviews, previews, interviews, features and a whole more.

      Inspired by this article i tried to make a finer script on similar lines
      Have a look :


      Inspired by this article i have tried to make a single script, have a look here:

    • TheOldFellow

      Useful. Pity the editor changed all the ” into “ and ” so that the scripts don’t actually work. People who publish Linux articles should know about this.


    • LordDarcy

      Works great! … Did need to replace the double quotes in the three scripts on page 4 with single quotes, though.

    • LordDarcy

      Works great! … Did need to replace the double quotes in the three scripts on page 4 with single quotes, though, and vice versa on the grep line.

    • carl

      Good stuff. Thanks.

    • JohnP

      While understanding how this task can be performed is useful, perhaps installing a FOSS tool like SysUsage to create performance graphs would result in greater usability?

    • pincho valla

      Is another and interesting way to measure things about your server, like rrdtool do. Congratulations for the clear and easy to follow article!

    • Pingback: IT-Technik / IT-Sicherheit | - GNU/Linux, Open Source, Softwareentwicklung, Methodik und Vim.

    • Pingback: IT-Technik / IT-Sicherheit – 2009-12-18 | - GNU/Linux, Open Source, Softwareentwicklung, Methodik und Vim.

    • jk04

      Nice and practical article. Adding “set grid” to the scripts would make the graphs look nicer.

    • Mark Seger

      Good article – similar to collectl but different. dstat reminds me a lot of collectl which does similar kinds of output but also provides provided a lot more detail, at least from a cursory read of the dstat website.

      Collectl would refer to the dstat output as ‘brief’ mode – great for a high level view of what’s going on but then you can also choose ‘verbose’ mode which shows a lot more data elements for each type of component you’re looking at and far too much to fit on one line. Then there’s ‘detail’ format which breaks down the verbose data by individual CPU, network or disk.

      Collectl also handles InfiniBand and Lustre data, something critical to HPC environments which was the initial target market.

      The collectl-utils rpm provides a tool called colplot, which is basically a web-based front-end to gnuplot. It has intimate knowledge of the types of data collectl collects, so you click a few check boxes and next thing you know some pretty cool plots show up. and


    • Michenux


      A fast and good solution to generate graphs from dstat log files is Vmstax.
      No configuration, just upload your log file and retrieve the generated graphs as png.

      More information at :

      Best regards

    • Pingback: How can I record system resource utilization over time on Ubuntu?

    • Vikas Kumar

      kSAR is also a neat and much easier alternative.


    • pharmacy technician training

      Hello my friend! I want to say that this post is amazing, nice written and include almost all vital infos.

      I’d like to see more posts like this .

    • Pingback: Good tools and approaches for diagnosing poor performance - Just just easy answers

    • icebox

      On my system I get
      Could not find/open font when opening font “arial”, using internal non-scalable font

      If I switch to
      set terminal pngcairo

      I get rid of the issue (it uses the cairo backend which knows the system fonts as opposed to GD)