iostat,vmstat,netstat使用心得

1,iostat
反映了磁盘I/O、CPU自系统启动至现在的活动状态

全称 Input Output statistics

语法: iostat <options> interval count

option - 让你指定所需信息的设备,像磁盘、cpu或者终端(-d , -c , -t or -tdc ) 。x 选项给出了完整的统计结果(gives the extended statistic)。
interval - 在两个samples之间的时间(秒)。
count - 就是需要统计几次



root@ubuntu:/# iostat
Linux 3.0.0-12-generic-pae (ubuntu) 03/14/2012 _i686_ (8 CPU)

avg-cpu: %user %nice %system %iowait %steal %idle
0.17 0.00 0.38 0.01 0.00 99.43

Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn
sda 2.87 95.28 25.15 18820231 4967656
dm-0 0.00 0.01 0.00 1464 4

avg-cpu的平均使用情况
%user 用户进程对cpu占用情况
%nice 优先级调度对cpu占用情况
%system 系统进程对cpu占用情况
%steal 我也忘记了
%idle 空闲cpu情况

tps 单次文件交换数
KB_read/s 磁盘读取速度
KB_writn/s 磁盘写入速度
KB_read 累积读取字节
KB_wrtn 累积写入字节

2,vmstat
反映了进程的虚拟内存、虚拟内存、磁盘、trap和cpu的活动情况
全称 Virtual Memory Statistics

语法:vmstat <options> interval count

option - 让你指定所需的信息类型,例如 paging -p , cache -c ,.interrupt -i etc.



root@ubuntu:/# vmstat
procs -----------memory---------- ---swap-- -----io---- -system-- ----cpu----
r b swpd free buff cache si so bi bo in cs us sy id wa
1 0 0 9583704 266368 14505652 0 0 12 3 11 20 0 0 99 0


3,netstat
通过选项来显示不通的网络相关的数据结构

全称 Network Statistics

语法:netstat <option/s>



root@ubuntu:/# netstat
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 61.147.88.104:7032 221.131.128.199:24722 SYN_RECV
tcp 0 0 61.147.88.104:7039 1.25.120.20:43058 SYN_RECV
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值