转Linux性能监控笔记
上一篇 / 下一篇 2012-02-29 17:05:57 / 个人分类:性能测试
原文地址:51Testing软件测试网0W)h4o V;{_1eqY
http://17610376.blog.51cto.com/366886/495836
*c+[1pcfG,H q R+P0
&e!_X|+c9e%X0
http://17610376.blog.51cto.com/366886/495836
*c+[1pcfG,H q R+P0
&e!_X|+c9e%X0
第 1 章 概述篇
hd ]8dE!j?s#X0针对四大方向
O(}n4JfgA0CPU
I6puiLU-tiZ0Memory
'f8~"t)OcAok0IO51Testing软件测试网%U o"PSS#K]
Network
]9E c)Qu/_ c0基本参考标准
hd ]8dE!j?s#X0针对四大方向
O(}n4JfgA0CPU
I6puiLU-tiZ0Memory
'f8~"t)OcAok0IO51Testing软件测试网%U o"PSS#K]
Network
]9E c)Qu/_ c0基本参考标准
# vmstat 1
procs memory swap io system cpu
r b swpd free buff cache si so bi bo in cs us sy wa id
1 0 138592 17932 126272 214244 0 0 1 18 109 19 2 1 1 96
0 0 138592 17932 126272 214244 0 0 0 0 105 46 0 1 0 99
安装监控工具 yum -y install sysstat
CWu.mw0表 1.1. 监控系统性能工具
CWu.mw0表 1.1. 监控系统性能工具
安装监控工具 yum -y install sysstat
表 1.1. 监控系统性能工具Tool | Description | Base | Repository |
vmstat | all purpose performance tool | yes | yes |
mpstat | provides statistics per CPU | no | yes |
sar | all purpose performance monitoring tool | no | yes |
iostat | provides disk statistics | no | yes |
netstat | provides network statistics | yes | yes |
dstat | monitoring statistics aggregator | no | in most distributions |
iptraf | traffic monitoring dashboard | no | yes |
netperf | Network bandwidth tool | no | In some distributions |
ethtool | reports on Ethernet interface configuration | yes | yes |
iperf | Network bandwidth tool | no | yes |
tcptrace | Packet analysis tool | no | yes |
strace | 查看相关进程读写的数据 | \:K+lq'_6[ H#S+C+y0 | 51Testing软件测试网5f4P$btj9\M#? |
第 2 章 CPU篇
n!K Gg!o$D6]? R0CPU调度优先级51Testing软件测试网c-@ J^ R&z:g*AH'G
Interrupts(中断)高于Kernel(System) Processes(内核处理过程)高于User Processes(用户进程)
UAr%FZ[*U0上下文切换
.gy8W+T;i8x C6B(Ca~5C0Linux 内核的系统在一个双核心处理器上,是报告显示为两个独立的处理器.
n!K Gg!o$D6]? R0CPU调度优先级51Testing软件测试网c-@ J^ R&z:g*AH'G
Interrupts(中断)高于Kernel(System) Processes(内核处理过程)高于User Processes(用户进程)
UAr%FZ[*U0上下文切换
.gy8W+T;i8x C6B(Ca~5C0Linux 内核的系统在一个双核心处理器上,是报告显示为两个独立的处理器.
一个线程要么就是获得时间额度或已抢先获得一些具有较高优先级(比如硬件中断),其中较高优先级的线程将从区域重新放置回处理器的队列中.这种线程的转换关系就是我们提到的上下文切换.51Testing软件测试网C+z;gP^
每次内核的上下文切换,资源被用于关闭在CPU寄存器中的线程和放置在队列中.系统中越多的上下文切换,在处理器的调度管理下,内核将得到更多的工作.51Testing软件测试网+E5Wc!Y `
运行队列
F+[;\5py*M?\5^M3L[0每个CPU 都维护一个线程的运行队列51Testing软件测试网0iK'Q VC
CPU 利用率
每次内核的上下文切换,资源被用于关闭在CPU寄存器中的线程和放置在队列中.系统中越多的上下文切换,在处理器的调度管理下,内核将得到更多的工作.51Testing软件测试网+E5Wc!Y `
运行队列
F+[;\5py*M?\5^M3L[0每个CPU 都维护一个线程的运行队列51Testing软件测试网0iK'Q VC
CPU 利用率