CPU Usage Analyses: ps

Definition of ps
The ps command provides detailed static and dynamic statistics about currently running processes. It can be used to monitor a process while it is still running.

This document covers using ps for CPU-usage diagnosis.
Performance Diagnosis
Technical articles
How to run the ps command

ps [-o etime,time,pcpu,command] [-u user] [-U user] [PID]

CPU-specific Command-Line Options for ps
Allows you to specify what process statistics you want to track. This list is comma separated with no spaces. The CPU-specific statistics are:
  • etime: elapsed time, the amount of time since the program
  • time: the amount of system plus user time the process spent running on the CPU.
  • pcpu: The percentage of CPU that the process is currently consuming
  • command: the command name
  • -A: show statistics about all processes
  • -u user: show statistics about all processes with this effective user ID
  • -U user: show statistics about all processes with this user ID

Performance Diagnosis
Technical articles