Linux-性能常用命令
按照CPU或者内存用量来筛选进程
ps -aux --sort -pcpu # 根据 cpu 用量筛选
ps -aux --sort -pmem # 根据 mem 用量筛选
ps -aux | sort -rnk 3 | head -20 # 找出当前系统CPU使用量较高的20个进程
ps -aux | sort -rnk 4| head -20 # 找出当前系统MEM使用量较高的20个进程vmstat 逐行输出虚拟内存状态统计信息
[root@localhost ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ------cpu-----
r b swpd free buff cache si so bi bo in cs us sy id wa st
2 0 40408 158164 0 664672 0 0 7 26 56 109 3 3 94 0 0参数解释:
mpstat 实时监控CPU性能
pidstat 监控全部或指定进程的资源占用情况
iostat 用于显示CPU和块设备(磁盘I/O)相关的统计信息
sar 系统活动情况报告
Last updated