zl程序教程

您现在的位置是:首页 >  系统

当前栏目

Linux性能测试 top衍生命令 atop/htop/slaptop

2023-09-14 08:59:45 时间

转自:http://www.cnblogs.com/txw1958/archive/2012/07/26/linux-from-top.html

1. Atop

Atop 是一个类似 top 的工具,但比 top 更有料。通过 Atop,你能够监视 Linux 系统的性能状况,包括进程活动、CPU、内存、硬盘、网络等方面的使用情况等。

 

2. htop

htop——一个可以让用户与之交互的进程查看器。作为文本模式的应用程序,主要用于控制台或 X 终端中。当前具有按树状方式来查看进程,支持颜色主题,可以定制等特性。

与 top 相比,htop 包含的优点有:

可以横向或纵向滚动浏览进程列表,以便看到所有的进程和完整的命令行。 在启动上,比 top 更快。 杀进程时不需要输入进程号。 htop 支持鼠标操作。 top 已经很老了。

复制代码 复制代码   1  [||||||||||||      Tasks: 652 total, 1 running                      14.4               61        3
  2  [||||       Load aver     0.16 0.16 0.17                            19.5                       02 0.10 0.14
  Mem[||||||    172/1009MB]     Uptime: 01:37:53                      3                        41:36
  PID USER     PRI  NI  VIRT   RES   SHR S CPU% MEM%   TIME+  Command  21705 bbndserv  16   0  2356  1228   784 R 38.0  0.1  0:00.12 htop  1 bbndserv  16   0  1784   640   544 S  0.0  0.1  0:02.12 init [3]
16753 bbndserv  11  -4  1676   392   216 S  0.0  0.0  0:00.00 /sbin/udevd --daemon
16023 bbndserv  16   0 33748 28588  2424 R  5.0  2.8  5:20.42 /opt/confd/lib/confd/bin/confd -K false -B -MHe true -- -root /opt/confd/lib/confd -progname confd -- -70523 bbndserv  17   0  2356  1316   860 R 0.1  0:07.73 htop
21672 bbndserv  25158M  6456  3352 S  16  0:07.08:11.38:07.64bb/platform/bin/rvnNetSerIfTblMgr
23313 bin       16158M  249M  7856  3880 0:00.1750.8  0:11.64 /opt/bb/platform/bin/rvnNetServer
21776 rpcuser   24249M  7856  3880   544 S  0.0  0.8  0:04.23 /opt/bb/platform/bin/rvnNetServer
23238 bbndserv  16   0  199M  6932  3488 S  0.0  0.7  0:01.76 /opt/bb/platform/bin/rvnSoftwareManager
    1 bbndserv  16   0  1784   640   544 S  0.0  0.1  0:02.12 init [3]
16753 bbndserv  11  -4  1676   392   216 S  0.0  0.010 port00 /sbin/udevd --daemon
16939 bbndserv  16   0 38148  2252  1188 S  0.0  0.2  0:01.67 /usr/local/bin/monit -I -c /etc/monitrc
20397 bbndserv  16524  38148  2252  1188 S  0.0  0.200 /usr/local/bin/monit -I -c /etc/monitrc
17640 bbndserv  25412   296   2448    58 S  0.0  0.0  0:00.00 smiattach -b 115200 /dev/ttyS1
17898 bin       161428   524   380   292 S  0.0  0.0  0:00.10 portmap
17916 rpcuser   18656   764   6446   460 S  0.0  0.1  0:00.00 rpc.statd
17933 bbndserv  162096  1412   108    56 S  0.0  0.0  0:00.92 /usr/sbin/rngd -r /dev/urandom
18054 bbndserv  251428   408   336  2088 S  0.0  0.0  0:00.00 /usr/sbin/acpid                               
18099 bbndserv  163404   660   460   600 S  0.0  0.1  0:00.00 /usr/sbin/sshd
18108 bbndserv  16096   888   7208   600 S  0.0  0.1  0:00.02 xinetd -stayalive -pidfile /var/run/xinetd.pid
18279 bbndserv  25   0  1600   160    60 S  0.0  0.0  0:00.00 rpc.mountd
18289 bbndserv  24928   192   1096  2088 S  0.0  0.0  0:00.00 /usr/sbin/vsftpd /etc/vsftpd/vsftpd.conf                      
18344 bbndserv  161620   740   600  2088 S  0.0  0.100 cron 复制代码 复制代码

 

3. slabtop

 

1.简介:实时显示内核slab内存缓存信息
2.使用:
slabtop –delay=n, -d n 每隔n秒刷新信息
slabtop –sort=S, -s S 按照S排序,其中S为排序标准
–once, -o 显示一次并退出

复制代码 复制代码
 Active / Total Objects (% used) : 15999517 (96.15 (96.2%)

 Active / Total Slabs (% used): 7786 / 746 / 7788 (99.5

 Active / Total Caches (% used) : 100 / 170 (58.8%)

 Active / Total Size (% used): 30126.39K022.57107.95K (96.5 (97.2

 OBJS ACTIVE USE OBJ SIZE SLABS OBJ/SLAB CACHE SIZE NAME K

 71682 71640 99% 0.05K 919783676K buffer_head

 21249 20762 97% 0.14K 787273148K dentry_cache

 7994 7940 99% 0.27K 571142284K radix_tree_node

 7040 6856 97% 0.09K 16044640K vm_area_struct

 6130 6108 99% 0.38K 613102452K proc_inode_cache

 5440 4488 82% 0.19K 272201088K filp

 4859 4803 98% 0.03K 43113172K size-32

 4505 4507 93% 0.53K 640 0

 72580K ext3_inode_cache

 4484 4484 100% 0.06K 7659304K size-64

 3451 3065 88% 0.02K 17203 68K anon_vma

 3404 3326 97% 0.04K 3792148K sysfs_dir_cache

 2400 2342 97% 0.12K 8030320K size-128

 1880 1866 99% 0.46K 235 8940K shmem_inode_cache

 1458 1458 100% 0.44K 162 9648K sock_inode_cache

 1360 1176 86% 0.19K 6820272K skbuff_head_cache

 1260 1255 99% 0.51K 180 7720K ext2_inode_cache

 1250 1216 97% 0.37K 12510500K inode_cache

 1220 1210 99% 2.00K 610 22440K size-2048

 1120 600 53% 0.23K 7016280K ip_conntrack

 8756 9781 98% 4.00K 876 13604K s50e-4096

 828 732 88% 0.04K992 36K acpi_operand

 812 409 50% 0.02K4203 16K tcp_bind_bucket

 735 721 98% 1.36K 147 51184K ta76_struct

 690 642 93% 0.25K 4615184K size-256
复制代码 复制代码

 


CPU使用率过高问题排查及Linux之top命令用法详解 hi(hardirq):表示 CPU 处理硬中断所花费的时间。硬中断是由外设硬件(如键盘控制器、硬件传感器等)发出的,需要有中断控制器参与,特点是快速执行。
Linux中top 实时监控系统进程状态 在top里按k然后杀死4148进程然后再输入9,(9是kill -l中的一个命令下面一会附上图)shift+m 从大到小。shift+p 从大到小。shift + n 从大到下。在top里按u然后输入用户。详细的请看我之前发的博客。linux常用命令下。linux常用命令中。linux常用命令上。...