File: cpu.rst

package info (click to toggle)
glances 3.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,944 kB
  • sloc: javascript: 26,103; python: 11,238; makefile: 229; sh: 169
file content (88 lines) | stat: -rw-r--r-- 3,252 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
.. _cpu:

CPU
===

The CPU stats are shown as a percentage or values and for the configured
refresh time.

The total CPU usage is displayed on the first line.

.. image:: ../_static/cpu.png

If enough horizontal space is available, extended CPU information are
displayed.

.. image:: ../_static/cpu-wide.png

A character is also displayed just after the CPU header and shows the
trend value:

======== ==============================================================
Trend    Status
======== ==============================================================
``-``    CPU value is equal to the mean of the six latests refreshes
``\``    CPU value is lower than the mean of the six latests refreshes
``/``    CPU value is higher than the mean of the six latests refreshes
======== ==============================================================

CPU stats description:

- **user**: percent time spent in user space. User CPU time is the time
  spent on the processor running your program's code (or code in
  libraries).
- **system**: percent time spent in kernel space. System CPU time is the
  time spent running code in the Operating System kernel.
- **idle**: percent of CPU used by any program. Every program or task
  that runs on a computer system occupies a certain amount of processing
  time on the CPU. If the CPU has completed all tasks it is idle.
- **nice** *(\*nix)*: percent time occupied by user level processes with
  a positive nice value. The time the CPU has spent running users'
  processes that have been *niced*.
- **irq** *(Linux, \*BSD)*: percent time spent servicing/handling
  hardware/software interrupts. Time servicing interrupts (hardware +
  software).
- **iowait** *(Linux)*: percent time spent by the CPU waiting for I/O
  operations to complete.
- **steal** *(Linux)*: percentage of time a virtual CPU waits for a real
  CPU while the hypervisor is servicing another virtual processor.
- **ctx_sw**: number of context switches (voluntary + involuntary) per
  second. A context switch is a procedure that a computer's CPU (central
  processing unit) follows to change from one task (or process) to
  another while ensuring that the tasks do not conflict.
- **inter**: number of interrupts per second.
- **sw_inter**: number of software interrupts per second. Always set to
  0 on Windows and SunOS.
- **syscal**: number of system calls per second. Do not displayed on
  Linux (always 0).

To switch to per-CPU stats, just hit the ``1`` key:

.. image:: ../_static/per-cpu.png

In this case, Glances will show on line per logical CPU on the system.
Logical cores means the number of physical cores multiplied by the number
of threads that can run on each core (this is known as Hyper Threading).

By default, ``steal`` CPU time alerts aren't logged. If you want that,
just add to the configuration file:

.. code-block:: ini

    [cpu]
    steal_log=True

Legend:

================= ============
CPU (user/system) Status
================= ============
``<50%``          ``OK``
``>50%``          ``CAREFUL``
``>70%``          ``WARNING``
``>90%``          ``CRITICAL``
================= ============

.. note::
    Limit values can be overwritten in the configuration file under
    the ``[cpu]`` and/or ``[percpu]`` sections.