Report issue Add example

pidstat

Monitors system resource usage for individual processes.

Description

pidstat is a command from the sysstat toolset. it is used to monitor the utilization of system resources (CPU, memory, threads, device I/O, etc.) for all or specific processes.

When run for the first time, pidstat displays statistics since system startup. Subsequent runs show statistics since the previous run. Users can specify the number of reports and the time interval between them.

Syntax

pidstat [options] [interval [count]]

Options

Examples

View CPU usage for all processes

# pidstat -u -p ALL
11:04:06 AM   UID       PID    %usr %system  %guest    %CPU   CPU  Command
11:04:06 AM     0         1    0.03    0.05    0.00    0.08    20  systemd
...

Header Meanings:

View memory usage for all processes

# pidstat -r
11:10:35 AM   UID       PID  minflt/s  majflt/s     VSZ    RSS   %MEM  Command
11:10:35 AM     0         1      7.24      0.05  191312   4208   0.01  systemd
...

Header Meanings:

View I/O usage for all processes

# pidstat -d
11:12:30 AM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s  Command
11:12:30 AM     0         1    250.05     11.57      2.13  systemd
...

Header Meanings:

View context switching activity

# pidstat -w
11:15:52 AM   UID       PID   cswch/s nvcswch/s  Command
11:15:52 AM     0         1      3.15      0.03  systemd
...

Header Meanings: