Linux系统CPU使用情况
- 博客分类:
- linux
linux下有几个命令可以从系统中提取出CPU或内存的使用情况,如top、uptime、free、vmstat等
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>top
top - 14:11:52 up 592 days, 19:43, 3 users, load average: 0.56, 0.56, 0.42
Tasks: 146 total, 1 running, 145 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.3%us, 0.0%sy, 0.0%ni, 98.0%id, 0.8%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8183648k total, 7330648k used, 853000k free, 138736k buffers
Swap: 8193108k total, 2225392k used, 5967716k free, 2748992k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24404 prm 16 0 2537m 2.4g 16m S 4 30.4 456:14.98 flowscheduler
23810 oracle 16 0 1713m 273m 269m S 1 3.4 14:11.07 oracle
23872 oracle 16 0 1712m 23m 19m S 0 0.3 1:05.45 oracle
8874 prm 16 0 5596 1240 868 R 0 0.0 0:00.03 top
1 root 16 0 780 68 40 S 0 0.0 28:30.43 init
2 root RT 0 0 0 0 S 0 0.0 0:36.57 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.04 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:16.46 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.10 ksoftirqd/1
6 root RT 0 0 0 0 S 0 0.0 0:30.67 migration/2
7 root 34 19 0 0 0 S 0 0.0 0:04.63 ksoftirqd/2
8 root RT 0 0 0 0 S 0 0.0 0:37.11 migration/3
9 root 34 19 0 0 0 S 0 0.0 0:00.10 ksoftirqd/3
10 root 10 -5 0 0 0 S 0 0.0 0:00.06 events/0
11 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
12 root 10 -5 0 0 0 S 0 0.0 0:00.25 events/2
13 root 10 -5 0 0 0 S 0 0.0 0:00.77 events/3
14 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper
15 root 10 -5 0 0 0 S 0 0.0 0:00.02 kthread
21 root 10 -5 0 0 0 S 0 0.0 0:00.98 kblockd/0
22 root 10 -5 0 0 0 S 0 0.0 0:02.10 kblockd/1
23 root 10 -5 0 0 0 S 0 0.0 0:18.15 kblockd/2
24 root 10 -5 0 0 0 S 0 0.0 0:19.84 kblockd/3
25 root 13 -5 0 0 0 S 0 0.0 0:00.00 kacpid
194 root 15 0 0 0 0 S 0 0.0 31:28.04 kswapd0
195 root 10 -5 0 0 0 S 0 0.0 0:00.00 aio/0
196 root 11 -5 0 0 0 S 0 0.0 0:00.00 aio/1
197 root 10 -5 0 0 0 S 0 0.0 0:00.00 aio/2
198 root 11 -5 0 0 0 S 0 0.0 0:00.00 aio/3
419 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/0
420 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/1
421 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/2
422 root 11 -5 0 0 0 S 0 0.0 0:00.00 cqueue/3
423 root 10 -5 0 0 0 S 0 0.0 0:00.00 kseriod
454 root 10 -5 0 0 0 S 0 0.0 0:00.00 kpsmoused
826 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/0
827 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/1
828 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/2
829 root 11 -5 0 0 0 S 0 0.0 0:00.00 ata/3
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>free
total used free shared buffers cached
Mem: 8183648 7330384 853264 0 138736 2748992
-/+ buffers/cache: 4442656 3740992
Swap: 8193108 2225392 5967716
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>uptime
2:13pm up 592 days 19:45, 3 users, load average: 0.58, 0.56, 0.43
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
2:13pm:系统当前时间
up 592 days 19:45 系统已经运行的时间
3 users:当前已经登录到系统的用户个数
load average: 0.58, 0.56, 0.43:1、5和15分钟的系统负载平均值
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 2225392 851784 138736 2748992 0 0 11 38 0 0 5 0 93 2 0
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
或
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 2225392 845940 138740 2750016 0 0 11 38 0 0 5 0 93 2 0
1 0 2225392 845940 138740 2750016 0 0 0 0 262 468 7 0 93 0 0
0 0 2225392 845948 138740 2750016 0 0 0 48 265 448 7 0 93 0 0
0 0 2225392 845948 138740 2750016 0 0 0 564 313 481 2 0 97 1 0
0 0 2225392 842188 138740 2750016 0 0 0 32 335 771 3 2 90 6 0
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
r: 等待CPU时间的进程数
b: 不间断休眠中的进程数
swpd: 使用的虚拟内存量(以MB为单位)
free: 未使用的物理内存量(以MB为单位)
buff: 用作缓存空间的内存量(以MB为单位)
cache: 用作高速缓存空间的内存量(以MB为单位)
si: 从磁盘交换的内存量(以MB为单位)
so: 交换到磁盘的内存量(以MB为单位)
bi: 从块设备收到的块数
bo: 发送到块设备的块数
in: 每秒CPU的中断数
cs: 每秒CPU的上下文交换数
us: CPU消耗在运行非内核代码上的时间百分比
sy: CPU消耗在运行内核代码上的时间百分比
id: CPU空间的时间百分比
wa: CPU消耗的在等待I/O上的时间百分比
st: 从虚拟机窃取的CPU时间百分比
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>top
top - 14:11:52 up 592 days, 19:43, 3 users, load average: 0.56, 0.56, 0.42
Tasks: 146 total, 1 running, 145 sleeping, 0 stopped, 0 zombie
Cpu(s): 1.3%us, 0.0%sy, 0.0%ni, 98.0%id, 0.8%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 8183648k total, 7330648k used, 853000k free, 138736k buffers
Swap: 8193108k total, 2225392k used, 5967716k free, 2748992k cached
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
24404 prm 16 0 2537m 2.4g 16m S 4 30.4 456:14.98 flowscheduler
23810 oracle 16 0 1713m 273m 269m S 1 3.4 14:11.07 oracle
23872 oracle 16 0 1712m 23m 19m S 0 0.3 1:05.45 oracle
8874 prm 16 0 5596 1240 868 R 0 0.0 0:00.03 top
1 root 16 0 780 68 40 S 0 0.0 28:30.43 init
2 root RT 0 0 0 0 S 0 0.0 0:36.57 migration/0
3 root 34 19 0 0 0 S 0 0.0 0:00.04 ksoftirqd/0
4 root RT 0 0 0 0 S 0 0.0 0:16.46 migration/1
5 root 34 19 0 0 0 S 0 0.0 0:00.10 ksoftirqd/1
6 root RT 0 0 0 0 S 0 0.0 0:30.67 migration/2
7 root 34 19 0 0 0 S 0 0.0 0:04.63 ksoftirqd/2
8 root RT 0 0 0 0 S 0 0.0 0:37.11 migration/3
9 root 34 19 0 0 0 S 0 0.0 0:00.10 ksoftirqd/3
10 root 10 -5 0 0 0 S 0 0.0 0:00.06 events/0
11 root 10 -5 0 0 0 S 0 0.0 0:00.00 events/1
12 root 10 -5 0 0 0 S 0 0.0 0:00.25 events/2
13 root 10 -5 0 0 0 S 0 0.0 0:00.77 events/3
14 root 10 -5 0 0 0 S 0 0.0 0:00.00 khelper
15 root 10 -5 0 0 0 S 0 0.0 0:00.02 kthread
21 root 10 -5 0 0 0 S 0 0.0 0:00.98 kblockd/0
22 root 10 -5 0 0 0 S 0 0.0 0:02.10 kblockd/1
23 root 10 -5 0 0 0 S 0 0.0 0:18.15 kblockd/2
24 root 10 -5 0 0 0 S 0 0.0 0:19.84 kblockd/3
25 root 13 -5 0 0 0 S 0 0.0 0:00.00 kacpid
194 root 15 0 0 0 0 S 0 0.0 31:28.04 kswapd0
195 root 10 -5 0 0 0 S 0 0.0 0:00.00 aio/0
196 root 11 -5 0 0 0 S 0 0.0 0:00.00 aio/1
197 root 10 -5 0 0 0 S 0 0.0 0:00.00 aio/2
198 root 11 -5 0 0 0 S 0 0.0 0:00.00 aio/3
419 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/0
420 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/1
421 root 10 -5 0 0 0 S 0 0.0 0:00.00 cqueue/2
422 root 11 -5 0 0 0 S 0 0.0 0:00.00 cqueue/3
423 root 10 -5 0 0 0 S 0 0.0 0:00.00 kseriod
454 root 10 -5 0 0 0 S 0 0.0 0:00.00 kpsmoused
826 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/0
827 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/1
828 root 10 -5 0 0 0 S 0 0.0 0:00.00 ata/2
829 root 11 -5 0 0 0 S 0 0.0 0:00.00 ata/3
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>free
total used free shared buffers cached
Mem: 8183648 7330384 853264 0 138736 2748992
-/+ buffers/cache: 4442656 3740992
Swap: 8193108 2225392 5967716
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>uptime
2:13pm up 592 days 19:45, 3 users, load average: 0.58, 0.56, 0.43
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
2:13pm:系统当前时间
up 592 days 19:45 系统已经运行的时间
3 users:当前已经登录到系统的用户个数
load average: 0.58, 0.56, 0.43:1、5和15分钟的系统负载平均值
======================================================================
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 2225392 851784 138736 2748992 0 0 11 38 0 0 5 0 93 2 0
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
或
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- -system-- -----cpu------
r b swpd free buff cache si so bi bo in cs us sy id wa st
0 0 2225392 845940 138740 2750016 0 0 11 38 0 0 5 0 93 2 0
1 0 2225392 845940 138740 2750016 0 0 0 0 262 468 7 0 93 0 0
0 0 2225392 845948 138740 2750016 0 0 0 48 265 448 7 0 93 0 0
0 0 2225392 845948 138740 2750016 0 0 0 564 313 481 2 0 97 1 0
0 0 2225392 842188 138740 2750016 0 0 0 32 335 771 3 2 90 6 0
prm@ATAE1-ESG-E4:/home/prm/mice/log/20111115>
r: 等待CPU时间的进程数
b: 不间断休眠中的进程数
swpd: 使用的虚拟内存量(以MB为单位)
free: 未使用的物理内存量(以MB为单位)
buff: 用作缓存空间的内存量(以MB为单位)
cache: 用作高速缓存空间的内存量(以MB为单位)
si: 从磁盘交换的内存量(以MB为单位)
so: 交换到磁盘的内存量(以MB为单位)
bi: 从块设备收到的块数
bo: 发送到块设备的块数
in: 每秒CPU的中断数
cs: 每秒CPU的上下文交换数
us: CPU消耗在运行非内核代码上的时间百分比
sy: CPU消耗在运行内核代码上的时间百分比
id: CPU空间的时间百分比
wa: CPU消耗的在等待I/O上的时间百分比
st: 从虚拟机窃取的CPU时间百分比
发表评论
-
linux常用命令二
2012-09-21 17:11 799// 查看IP地址 $ ifconfig // ... -
linux 共享磁盘mount
2012-09-21 16:25 1790用root用户登录linux系统 步骤 1 cd 进入m ... -
linux 安装jdk
2012-09-21 14:39 747下载linux环境下的jdk安装包:j2sdk-1_4_2_ ... -
stat命令(获取文件信息)
2012-02-10 12:43 937>ll drwxr-xr-x 3 root root 7 ... -
shell实现文件拆分
2011-12-23 14:33 3325#!/bin/sh #方法二 SUFFIX=txt #源目录: ... -
suse linux 10 安装JDK 配置环境变量
2011-12-23 14:28 72531.JDK安装 下载最新Linux ... -
shell实现FTP上传文件
2011-11-16 17:59 990#!/bin/sh echo "open 192.1 ... -
shell脚本实现系统监视统计
2011-11-16 14:18 12551、监视系统统计信息 要自动监视系统的磁盘空间,首先要使用可以 ... -
shell下获取系统时间的方法
2011-11-16 13:39 1348直接调用系统变量 获取今天时期:`date +%Y%m%d` ... -
操作系统
2011-08-04 17:53 891操作系统:Windows、UNIX、Linux、MAC(苹果专 ... -
linux crontab 定时任务
2011-05-10 15:49 14341. crontab 用来执行定时任务 1.1 命令格式: ... -
Linux系统下查看oracle SID的方法
2011-04-11 17:01 26111. 登陆oracle用户 2. 修改/home/ora ... -
linux下oracle数据库服务和监听的启动停止
2011-04-11 16:59 15121、启动数据库: oracle@suse92:~> sq ... -
linux SCP 文件传输
2011-03-31 16:56 3685linux 文件传输 #将本地文件复制到远程服务器中(远程服 ... -
linux Tcl、expect 安装
2011-03-30 16:06 5758需要两个安装程序tcl8.4.13-src.tar.gz、ex ... -
linux常用命令一
2011-02-22 17:48 2011--将username用户添加到groupname组中 use ... -
Linux远程拷贝之ftp与scp命令
2010-12-30 15:14 2357ftp命令: 其中一台 ... -
Oracle Merge Into
2010-10-30 16:39 1271用途 merge 命令可以用来用一个表中的数据来修改或者插入到 ...
相关推荐
Linux下查看CPU使用\系统资源使用情况,非常详细,非常实用。
操作系统大作业:基于QT开发的linux系统CPU监视器.zip 操作系统大作业:基于QT开发的linux系统CPU监视器.zip 操作系统大作业:基于QT开发的linux系统CPU监视器.zip 操作系统大作业:基于QT开发的linux系统CPU监视器....
调整Linux系统CPU频率.pdf
Qt linux获取cpu使用率、内存、网络收发速度、磁盘读写速度、磁盘剩余空间等
C/C++实现linux和Windows查看系统、进程、服务的内存和CPU使用情况的源代码,生成的是静态链接库,Windows和Linux下经测试都可用,查看系统、指定名称的服务、指定名称的进程占用CPU和内存,查看方式不是通过程序中...
linux系统cpu、内存、IO等监控脚本 可以用作定时任务执行监控
用java取得linux系统cpu、内存的实时信息
科学计算通常占用较多的 CPU,大部分计算工作都需要在 CPU 上完成,内存、硬盘等子系统只做暂时的数据存储工作。要想监测和理解 CPU 的性能需要知道一些的操作系统的基本知识,比如:中断、进程调度、进程上下文切换...
在Linux系统下将cpu、内存等信息获取并放在同一个文件中的C++源码,需要g++才能编译
go读取Linux下cpu占用率、cpu温度、内存占用率及磁盘占用率
获取CPU使用率,主频和内存大小,使用率等系统实时,硬件参数。Linux上面运行。
Linux监视CPU的命令,教你如何随时监视Linux的系统性能。
本文定位:想通过python调用top命令获取cpu使用率但暂时没有思路的情况。 如果单纯为了获得cpu的利用率,通过top命令重定向可以轻松实现,命令如下: 复制代码 代码如下: top -bi > cpuHistory.log 或 复制代码 代码...
利用该代码的移植,可以获取基于linux系统上的开发板的cpu和内存的使用情况
关于 top 命令的详细说明请参看 使用top命令分析linux系统性能的详解 这篇文章。 top命令是Linux下常用的性能分析工具,能够实时显示系统中各个进程的资源占用状况,类似于Windows的任务管理器;不过这里我们主要是...
在Linux中如果要监视一个进程的运行情况,如查看它的CPU使用效率和内存使用情况,就需要从系统的/proc目录的读取一些系统信息。本文介绍了获得系统CPU和内存情况的代码。
linux 系统资源监控nmon+生成Excle报告 备注:1.生成报告错误时解析,跟换CPU个数,一般都OK; 2.上传文件3份:监控软件一份、解析文件一份、命令说明一份; 3.多尝试几次;本人认为很好用;
Linux是一套免费使用和自由传播的类Unix操作系统,它主要用于基于Intel x86 系列CPU的计算机上。这个系统是由世界各地的成千上万的程序员设计和实现的。它 的建立不受任何商品化软件的版权制约的、全世界都能自由...
如何教你查看linux系统CPU利用率.docx如何教你查看linux系统CPU利用率.docx