进程

进程状态:

  运行中

  就绪

  停止

3、常用的查看进程的命令

ps

  静态查看进程信息

  ps aux / ps aux|less

top

  实时的进程监控

  常用命令

top 查看所有进程

[root@yxlll ~]# top
top - 16:27:13 up 2 days, 21:44,  1 user,  load average: 0.00, 0.01, 0.05
Tasks:  68 total,   1 running,  67 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.7 us,  0.3 sy,  0.0 ni, 99.0 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st
KiB Mem :  1882028 total,  1377340 free,    83532 used,   421156 buff/cache
KiB Swap:        0 total,        0 free,        0 used.  1647020 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S %CPU %MEM     TIME+ COMMAND                                                    
 1051 root      10 -10  133140  15016  10212 S  0.7  0.8  25:56.03 AliYunDun                                                  
    1 root      20   0   51788   3892   2600 S  0.0  0.2   0:39.90 systemd                                                    
    2 root      20   0       0      0      0 S  0.0  0.0   0:00.00 kthreadd                                                   
    4 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 kworker/0:0H                                               
    5 root      20   0       0      0      0 S  0.0  0.0   0:00.71 kworker/u2:0                                               
    6 root      20   0       0      0      0 S  0.0  0.0   0:00.94 ksoftirqd/0                                                
    7 root      rt   0       0      0      0 S  0.0  0.0   0:00.00 migration/0                                                
    8 root      20   0       0      0      0 S  0.0  0.0   0:00.00 rcu_bh                                                     
    9 root      20   0       0      0      0 S  0.0  0.0   0:15.23 rcu_sched                                                  
   10 root       0 -20       0      0      0 S  0.0  0.0   0:00.00 lru-add-drain                                              
--- //可翻页

按 enter手动刷新,q退出

top -d 1 1秒自动刷新一次

top -d 1 -p 10 单独查看PID为10的进程

top -u root  查看所有 root用户的进程

//案例,模拟访问网址
ab -c 100 -n 100 http://www.baidu.com/index.html

//   -c 100表示并发用户100人
//   -n 100表示请求总数为100次

//请求100次,并发100个用户

  

原文地址:https://www.cnblogs.com/yxlll/p/13965489.html