linux unix性能工具-1 -监测工具简介
时间:2006-11-04 来源:oychw
§1, 监测工具简介
§1.1 监测工具
可以分为4类:
1,内核统计收集工具
比如: vmstat, mpstat, and netstat.
· Mpstat: 每个处理器的统计和使用情况
· Vmstat 内存,运行队列, 统计的CPU使用
· Iostat: 磁盘I/O子系统操作,带宽和使用
· Netstat: 网络接口包速率,错误和冲突
· Kstat: 显示内核统计
· Sar 系统活动报告
以上命名只有netstat不是动态变化的.
2,进程工具:
比如: prstat, ptree, and pfiles.
· prstat - report active process statistics
· ps - report process status
每个进程的信息可由叫ptools或process tools的获取.这些工具位于进程文件系统中,在/proc
· pargs(1). Display process argument list.
· pflags(1). Display process flags.
· pcred(1). Display process credentials.
· pldd(1). Display process shared object library dependencies.
· psig(1). Display process signal dispositions.
· pstack(1). Display process stack.
· pmap(1). Display process address space mappings.
· pfiles(1). Display process opened files with names and flags.
· ptree(1). Display process family tree.
· ptime(1). Time process execution.
· pwdx(1). Display process working directory.
Process control is available with various ptools.
· pgrep(1). Search for a process name string, and return the PID.
· pkill(1). Send a kill signal or specified signal to a process or process list.
· pstop(1). Stop a process.
· prun(1). Start a process that has been stopped.
· pwait(1). Wait for a process to terminate.
· preap(1). Reap a zombie (defunct) process.
3,调测工具:
比如: truss and MDB.
· truss(1). Trace functions and system calls.
· mdb(1). Debug or control processes.
· dtrace(1M). Trace, analyze, control, and debug processes.
· plockstat(1M). Track user-defined locks in processes and threads.
· cputrack(1). Track per-processor hardware counters for a process.
· cpustat(1M). Track per-processor hardware counters.
· busstat(1M). Track interconnect bus hardware counters
4,动态工具;
比如: DTrace
§1.2 Drill-Down 分析
1,监测:
可能使用SunMC, SNMP or sar 以获取全面的信息
2,鉴别
可能使用kstat and procfs tools
3,分析
可能使用TRuss, DTrace, and MDB.
§1.3 其他
本书中,使用率和饱和是有区别的,后者主要是针对队列.
工具的主要来源是:
http://www.solarisinternals.com.
· Tools bundled with Solaris: based on Kstat, procfs, DTrace, etc.
· Tools from solarisinternals.com: Memtool and others.
· Tools from Brendan Gregg: DTraceToolKit and K9Toolkit