linux 资源管理

1. 查看内存信息  free

[root@rhel6 script]# free
             total       used       free     shared    buffers     cached
Mem:       3920488     585108    3335380        188     144312     219976
-/+ buffers/cache:     220820    3699668
Swap:      6143996          0    6143996

2. 获取进程状态 ps

1). 根据用户过滤进程 ps -u mysql

2). 通过cpu和内存使用来过滤进程   ps -aux  (可以根据cpu mem进行排序 --sort pcpu  --sort pmem)

3). 通过进程名和PID过滤  ps -f -C mysqld

3. 查看进程树 pstree

4. 动态显示进程使用资源 top

5. dstat可以让你实时地看到所有系统资源

原文地址:https://www.cnblogs.com/vincenshen/p/6605373.html