The pidstat command is used for monitoring individual tasks currently being managed by the Linux kernel.


apt-get install sysstat


pidstat [options] [interval] [times]

Most common use options:

  • -r show memory usage
  • -d show io usage per process id
  • -p PID specify PID


Show CPU usage of all process

pidstat -p ALL

Show memory usage

Following command will display PID memory usage 10 times every 2 seconds:

pidstat -r -p PID 2 10

Result fields:

  • PID
  • Minflt/s
  • Majflt/s
  • VSZ virtual memory usage KB
  • RSS KB
  • Command task name

show IO usage

pidstat -d -p PID

Result field:

  • PID
  • kB_rd/s read from disk each second KB
  • kB_wr/s write to disk each second KB
  • kB_ccwr/s
  • Command task name