Monitoring CPU performance

This recipe will show you how to visualize using pmchart and command-line tools to monitor your CPU's performance. We will have a look at the following metrics:

  • kernel.all.cpu.wait.total
  • kernel.all.cpu.irq.hard
  • kernel.all.cpu.irq.soft
  • kernel.all.cpu.steal
  • kernel.all.cpu.sys
  • kernel.all.cpu.user
  • kernel.all.cpu.nice
  • kernel.all.cpu.idle

How to do it…

This will show you how to create the text and graphical representation of performance data. Perform the following steps:

  1. Display live data for the preceding metrics with a 1-second interval for the host, localhost. Execute the following command:
    ~]# pmdumptext -H -t 1 -i -l kernel.all.cpu.wait.total kernel.all.cpu.irq.hard kernel.all.cpu.irq.soft kernel.all.cpu.steal kernel.all.cpu.sys kernel.all.cpu.user kernel.all.cpu.nice kernel.all.cpu.idle -h localhost
    
    How to do it…
  2. Create a configuration file for pmchart to display live data called cpu_stack.conf with the following contents:
    #kmchart
    version 1
    
    chart style stacking antialiasing off
            plot color #aaaa7f metric kernel.all.cpu.wait.total
            
    plot color #008000 metric kernel.all.cpu.irq.hard
            plot color #ee82ee metric kernel.all.cpu.irq.soft
            plot color #666666 metric kernel.all.cpu.steal
            plot color #aa00ff metric kernel.all.cpu.user
            plot color #aaff00 metric kernel.all.cpu.sys
            plot color #aa5500 metric kernel.all.cpu.nice
            plot color #0000ff metric kernel.all.cpu.idle
    

    You will notice that I don't use all the metrics in the graph as some of the metrics are combined with one another.

  3. Use pmchart to plot a live chart for guest.example.com, as follows:
    ~]# pmchart -h guest.example.com -c cpu_stack.conf
    
    How to do it…
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset