一、vmstat + iostat 查看 磁盘IO负载状况 ios
vmstat是Virtual Meomory Statistics(虚拟内存统计) spa
# 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
1 0 0 900236 17628 31912 0 0 6 1 11 10 0 0 100 0 0
0 0 0 900212 17628 31932 0 0 0 0 10 9 0 0 100 0 0
0 0 0 900212 17628 31932 0 0 0 5 13 10 0 0 100 0 0
0 0 0 900212 17628 31932 0 0 0 10 12 10 0 0 100 0 0
0 0 0 900212 17628 31932 0 0 0 0 14 7 0 0 100 0 0 队列
proc: r 运行队列中等待的进程数 b 等待io的进程数 进程
memory(kb): swpd 可用的交换内存 free 空闲内存 buff 缓冲 cache 高速缓冲内存 内存
swap: si 磁盘到内存的交换页数量 so 内存到磁盘的交换页数量 kb/s it
io : bi 发送的快设备数(读取) bo: 从块设备接受的块数(写入) 块/s io
system: in 每秒的中断数,包括时钟中断 cs 每秒的环境(上下文)转换次数 统计
cpu : us 用户进程使用时间比 sy 系统进程使用时间比 id 空闲率 wa 等待io cpu时间 cpu
//判断负载,IO 磁盘读写是否太高,能够查看 r ,b 和 wa 的时间,能够结合 iostat 查看判断是不是磁盘读写致使IO很高 异常
iostat -x 1 2
avg-cpu: %user %nice %system %iowait %steal %idle
7.08 0.00 0.79 0.03 0.12 91.98
Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
vda 0.00 2.34 0.01 2.04 0.27 35.07 17.21 0.01 3.49 0.62 0.13
vdb 0.00 12.91 0.04 14.51 2.25 219.37 15.23 0.07 4.84 0.11 0.17
// 若是持续超过 75% 以上需注意,检查相关服务的访问是否异常