glances/docs/aoa/ps.rst

152 lines
5.4 KiB
ReStructuredText
Raw Normal View History

2016-03-02 12:29:19 +00:00
.. _ps:
Processes List
==============
Compact view:
.. image:: ../_static/processlist.png
Full view:
.. image:: ../_static/processlist-wide.png
Filtered view:
.. image:: ../_static/processlist-filter.png
The process view consists of 3 parts:
- Processes summary
- Monitored processes list (optional)
- Processes list
The processes summary line displays:
2021-07-11 16:55:11 +00:00
- Total number of tasks/processes (aliases as total in the Glances API)
- Number of threads
- Number of running tasks/processes
- Number of sleeping tasks/processes
- Other number of tasks/processes (not in running or sleeping states)
- Sort key for the process list
2016-03-02 12:29:19 +00:00
By default, or if you hit the ``a`` key, the processes list is
automatically sorted by:
- ``CPU``: if there is no alert (default behavior)
- ``CPU``: if a CPU or LOAD alert is detected
- ``MEM``: if a memory alert is detected
- ``DISK I/O``: if a CPU iowait alert is detected
You can also set the sort key in the UI:
- by clicking on left and right arrows
- by clicking on the following shortcuts or command line option:
===== ==================== ===============================
``a`` Automatic sort
``c`` Sort by CPU --sort-processes cpu_percent
``i`` Sort by DISK I/O --sort-processes io_counters
``m`` Sort by MEM --sort-processes memory_percent
``p`` Sort by process name --sort-processes name
``t`` Sort by CPU times --sort-processes cpu_times
``u`` Sort by username --sort-processes username
2016-03-02 12:29:19 +00:00
The number of processes in the list is adapted to the screen size.
Columns display
---------------
========================= ==============================================
``CPU%`` % of CPU used by the process
If Irix/Solaris mode is off ('0' key), the value
is divided by logical core number
2019-11-02 12:42:24 +00:00
``MEM%`` % of MEM used by the process (RES divided by
the total RAM you have)
2016-03-02 12:29:19 +00:00
``VIRT`` Virtual Memory Size
The total amount of virtual memory used by the
2017-03-12 17:52:17 +00:00
process.
It includes all code, data and shared
2016-12-03 17:07:24 +00:00
libraries plus pages that have been swapped out
and pages that have been mapped but not used.
2019-11-02 12:42:24 +00:00
Most of the time, this is not a useful number.
2016-03-02 12:29:19 +00:00
``RES`` Resident Memory Size
The non-swapped physical memory a process is
2017-03-12 17:52:17 +00:00
using (what's currently in the physical memory).
2016-03-02 12:29:19 +00:00
``PID`` Process ID
``USER`` User ID
2018-05-08 15:59:10 +00:00
``THR`` Threads number of the process
``TIME+`` Cumulative CPU time used by the process
2016-03-02 12:29:19 +00:00
``NI`` Nice level of the process
``S`` Process status
The status of the process:
2017-03-12 17:52:17 +00:00
2016-12-03 17:07:24 +00:00
- ``R``: running or runnable (on run queue)
- ``S``: interruptible sleep (waiting for an event)
2017-03-12 17:52:17 +00:00
- ``D``: uninterruptible sleep (usually I/O)
2016-12-03 17:07:24 +00:00
- ``Z``: defunct ("zombie") process
2019-11-02 12:42:24 +00:00
- ``T``: traced by job control signal
- ``t``: stopped by debugger during the tracing
2016-12-03 17:07:24 +00:00
- ``X``: dead (should never be seen)
2016-03-02 12:29:19 +00:00
``R/s`` Per process I/O read rate in B/s
``W/s`` Per process I/O write rate in B/s
``COMMAND`` Process command line or command name
User can switch to the process name by
pressing on the ``'/'`` key
========================= ==============================================
2019-11-02 12:42:24 +00:00
Source: Thanks to the Peteris Ņikiforovs's blog.
Process filtering
-----------------
It's possible to filter the processes list using the ``ENTER`` key.
Filter syntax is the following (examples):
2017-03-12 17:52:17 +00:00
- ``python``: Filter processes name or command line starting with
*python* (regexp)
- ``.*python.*``: Filter processes name or command line containing
*python* (regexp)
- ``username:nicolargo``: Processes of nicolargo user (key:regexp)
- ``cmdline:\/usr\/bin.*``: Processes starting by */usr/bin*
2016-03-02 12:29:19 +00:00
Extended info
-------------
.. image:: ../_static/processlist-top.png
In standalone mode, additional information are provided for the top
process:
========================= ==============================================
``CPU affinity`` Number of cores used by the process
``Memory info`` Extended memory information about the process
For example, on Linux: swap, shared, text,
lib, data and dirty
``Open`` The number of threads, files and network
sessions (TCP and UDP) used by the process
``IO nice`` The process I/O niceness (priority)
========================= ==============================================
The extended stats feature can be enabled using the
``--enable-process-extended`` option (command line) or the ``e`` key
(curses interface).
In curses/standalone mode, you can select a process using ``UP`` and ``DOWN`` and press:
2021-07-11 16:55:11 +00:00
- ``k`` to kill the selected process
2016-03-02 12:29:19 +00:00
.. note::
Limit for CPU and MEM percent values can be overwritten in the
configuration file under the ``[processlist]`` section. It is also
possible to define limit for Nice values (comma separated list).
For example: nice_warning=-20,-19,-18