Official website for Linux User & Developer

Create a graph of your system’s performance

Posted by Gavin Thomas

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

Once the installation is complete, run a quick test to check if Dstat was installed correctly. Run the following command in a terminal window:
# dstat
Now hit the key combination Ctrl+C in order to exit Dstat.

Introducing Gnuplot
Gnuplot is a fantastic scientific package for visualising data and plotting functions. It’s a cross-platform open source project and is available for free download. This tool is very handy whenever you need to create production-quality graphs from a set of data. It is no wonder that in the 20-plus years of its existence, it has been employed in various industries. Flexible, powerful and easy to use, Gnuplot is not only useful as a standalone program but can also be used with a variety of programming languages, including Ruby, Python and Perl. It has also been adopted as a plotting engine by open source programs such as GNU Octave. The minimal effort required to learn Gnuplot is therefore quite worthwhile. Being able to visualise things as you analyse data and explore mathematics can prove to be invaluable.

In this article we will use Gnuplot to generate graphs from the data we gather using Dstat. We will share a set of scripts with which we will take the Dstat data file as input and return an image file containing the graph.

Gnuplot setup
Gnuplot ships by default with most modern distributions of Linux. It is quite likely that you have Gnuplot already installed on your Linux machine. To locate it you can run the command ‘# whereis gnuplot’. The command should return something like ‘/usr/bin/gnuplot’, which means that you already have Gnuplot installed. If this command doesn’t return you a positive result, it means that you don’t have Gnuplot installed and will need to do so. The installation of Gnuplot is a bit more complex than that of Dstat. Ubuntu and Fedora users should be able to use their package management systems to get it installed, as follows.

On Ubuntu, run the following command:
# sudo apt-get install gnuplot

For Fedora Linux users:
# yum install gnuplot
If you don’t have Gnuplot installed and can’t find a working binary for your distribution, we suggest you look at the Gnuplot documentation to see how to get it installed on your machine. Mind you, the source installation is for the brave.

After the installation, run a check to see if Gnuplot was installed correctly. Run the command ‘gnuplot’ in the terminal. You should be greeted by a message and then presented with the interactive Gnuplot interface. Type ‘exit’ to quit the application.

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)

    • Pingback: Raspberry Pi Raspbian CPU Performance Graph | DL-UAT()

    • MarkC

      Very simple and useful for profiling a period of time on a given machine. Thanks for a very useful post :-)