Vmstat: Difference between revisions

From Yocto Project
Jump to navigationJump to search
No edit summary
 
(7 intermediate revisions by 2 users not shown)
Line 2: Line 2:
The following results were obtained based on data collected using <tt>vmstat</tt>, a tool that reports a system's virtual memory statistics.  
The following results were obtained based on data collected using <tt>vmstat</tt>, a tool that reports a system's virtual memory statistics.  


In order to reproduce the output shown in section 2, one should:
These plots were produced using the scripts located on the [https://github.com/lsandoval/bb-perf bb-perf] repository.
 
* Fetch upstream code from the <tt>core-image-minimal</tt> recipes
 
$ git clone git://git.yoctoproject.org/poky
$ cd poky/
$ source oe-init-build-env
$ echo -e 'DL_DIR = "/home/user/poky/downloads"' > conf/auto.conf
$ bitbake core-image-minimal -c fetchall
 
* Start vmstat in a new terminal (set a 2 sec interval)
$ vmstat 2 > vmstat-output.raw
 
* On the terminal from the first step, launch bitbake, making sure no network activity will be done
$ echo -e 'BB_NO_NETWORK = "1"' >> conf/auto.conf
$ bitbake core-image-minimal
 
* Once <tt>bitbake</tt> finishes, <tt>Ctrl+D</tt> the <tt>vmstat</tt> command to stop it


=System Characteristics=
=System Characteristics=
Line 53: Line 36:
       r: The number of runnable processes (running or waiting for run time).
       r: The number of runnable processes (running or waiting for run time).
       b: The number of processes in uninterruptible sleep.
       b: The number of processes in uninterruptible sleep.
[[File:Vmstat-procs-minimal.png|thumb|center|500px]]
[[File:Vmstat-procs-minimal.png|center|800px]]
== Memory Usage==
== Memory Usage==
   Memory
   Memory
Line 60: Line 43:
       buff: the amount of memory used as buffers.
       buff: the amount of memory used as buffers.
       cache: the amount of memory used as cache.
       cache: the amount of memory used as cache.
[[File:Vmstat-memory-minimal.png|thumb|center|500px]]
[[File:Vmstat-memory-minimal.png|center|800px]]
== IO Activity==
== IO Activity==
   IO
   IO
       bi: Blocks received from a block device (blocks/s).
       bi: Blocks received from a block device (blocks/s).
       bo: Blocks sent to a block device (blocks/s).
       bo: Blocks sent to a block device (blocks/s).
[[File:Vmstat-io-minimal.png|thumb|center|500px]]
[[File:Vmstat-io-minimal.png|center|800px]]
== System Operations==
== System Operations==
   System
   System
       in: The number of interrupts per second, including the clock.
       in: The number of interrupts per second, including the clock.
       cs: The number of context switches per second.
       cs: The number of context switches per second.
[[File:Vmstat-system-minimal.png|thumb|center|500px]]
[[File:Vmstat-system-minimal.png|center|800px]]
== CPU Resources==
== CPU Resources==
   CPU
   CPU
Line 79: Line 62:
       wa: Time spent waiting for IO.  Prior to Linux 2.5.41, included in idle.
       wa: Time spent waiting for IO.  Prior to Linux 2.5.41, included in idle.
       st: Time stolen from a virtual machine.  Prior to Linux 2.6.11, unknown.
       st: Time stolen from a virtual machine.  Prior to Linux 2.6.11, unknown.
[[File:Vmstat-cpu-minimal.png|thumb|center|500px]]
[[File:Vmstat-cpu-minimal.png|center|1000px]]
 
 
<!--=== Procs ===
The <tt>procs</tt> section reports the number of processing jobs waiting to be run.
 
<tt>r</tt>: runnable processes
 
<tt>b</tt>: processes in uninterruptible sleep
==== Bitbake core-image-minimal ====
[[File:Vmstat-procs.png|thumb|left|500px]]
 
==== Bitbake world ====
[[File:Vmstat-procs-world.png]]
 
=== Memory ===
==== Bitbake core-image-minimal ====
[[File:Vmstat-memory.png]]
==== Bitbake world ====
[[File:Vmstat-memory-world.png]]


=== IO ===
=Reproducibility=
==== Bitbake core-image-minimal ====
The overall behavior of each plot is the same when the monitoring script <tt>(vmstat.sh)</tt> is ran several times in the same machine; however, there are two cases where the plots mismatched with each other.
[[File:Vmstat-io.png]]
==== Bitbake world ====
[[File:Vmstat-io-world.png]]


=== System ===
== IO Activity ==
==== Bitbake core-image-minimal ====
The IO Activity plots are rather similar, but the Reading activity has different ranges as it is shown below.
[[File:Vmstat-system.png]]
<gallery class="center" widths = "500" heights = "400">
==== Bitbake world ====
Image:Vmstat-io-minimal.png|Results obtained running the script for the first time
[[File:Vmstat-system-world.png]]
Image:Vmstat-io-minimal-2.png|Results obtained running the script for the second time
</gallery>


=== CPU ===
== CPU Resources ==
==== Bitbake core-image-minimal ====
Although the behavior is quite similar between the plots, the CPU waiting time curve has different ranges as it is shown below.
[[File:Vmstat-cpu.png]]
<gallery class="center" widths = "900" heights = "400">
==== Bitbake world ====
Image:Vmstat-cpu-minimal.png|Results obtained running the script for the first time
[[File:Vmstat-cpu-world.png]]-->
Image:Vmstat-cpu.png|Results obtained running the script for the second time
</gallery>

Latest revision as of 21:59, 14 March 2017

System monitoring with vmstat

The following results were obtained based on data collected using vmstat, a tool that reports a system's virtual memory statistics.

These plots were produced using the scripts located on the bb-perf repository.

System Characteristics

Distro

CentOS Linux release 7.3.1611 (Core)
Linux version 3.10.0-514.6.1.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-11) (GCC) ) #1 SMP Wed Jan 18 13:06:36 UTC 2017

RAM

MemTotal:       131814472 kB
MemFree:        70067576 kB
MemAvailable:   127241460 kB

Processor

Architecture:          x86_64
CPU op-mode(s):        32-bit, 64-bit
Byte Order:            Little Endian
CPU(s):                48
On-line CPU(s) list:   0-47
Thread(s) per core:    2
Core(s) per socket:    12
Socket(s):             2
NUMA node(s):          2
Vendor ID:             GenuineIntel
CPU family:            6
Model:                 62
Model name:            Intel(R) Xeon(R) CPU E5-2697 v2 @ 2.70GHz
Stepping:              4
CPU MHz:               1263.621

Vmstat Output

Processing Jobs

  Procs
      r: The number of runnable processes (running or waiting for run time).
      b: The number of processes in uninterruptible sleep.
Vmstat-procs-minimal.png

Memory Usage

  Memory
      swpd: the amount of virtual memory used.
      free: the amount of idle memory.
      buff: the amount of memory used as buffers.
      cache: the amount of memory used as cache.
Vmstat-memory-minimal.png

IO Activity

  IO
      bi: Blocks received from a block device (blocks/s).
      bo: Blocks sent to a block device (blocks/s).
Vmstat-io-minimal.png

System Operations

  System
      in: The number of interrupts per second, including the clock.
      cs: The number of context switches per second.
Vmstat-system-minimal.png

CPU Resources

  CPU
      These are percentages of total CPU time.
      us: Time spent running non-kernel code.  (user time, including nice time)
      sy: Time spent running kernel code.  (system time)
      id: Time spent idle.  Prior to Linux 2.5.41, this includes IO-wait time.
      wa: Time spent waiting for IO.  Prior to Linux 2.5.41, included in idle.
      st: Time stolen from a virtual machine.  Prior to Linux 2.6.11, unknown.
Vmstat-cpu-minimal.png

Reproducibility

The overall behavior of each plot is the same when the monitoring script (vmstat.sh) is ran several times in the same machine; however, there are two cases where the plots mismatched with each other.

IO Activity

The IO Activity plots are rather similar, but the Reading activity has different ranges as it is shown below.

CPU Resources

Although the behavior is quite similar between the plots, the CPU waiting time curve has different ranges as it is shown below.