安装sysstat包。在Ubuntu下,执行如下操作
sudo apt install sysstat
The sysstat package contains the following system performance tools:
- sar: collects and reports system activity information;
- iostat: reports CPU utilization and disk I/O statistics;
- tapestat: reports statistics for tapes connected to the system;
- mpstat: reports global and per-processor statistics;
- pidstat: reports statistics for Linux tasks (processes);
- sadf: displays data collected by sar in various formats;
- cifsiostat: reports I/O statistics for CIFS filesystems.
譬如用pidstat查看系统进程情况。
pidstat -u 5 20