UNIX 系统性能 - Unix

本教程的目的是引进性能分析师提供的免费工具,来监视和管理UNIX系统的性能,以及如何诊断和修复性能问题在Unix环境提供指引。

UNIX具有以下主要资源类型,需要进行监测和调整:

  • CPU

  • 内存

  • 磁盘空间

  • 通信线路

  • I/O 时间

  • 网络时间

  • 应用程序

性能组件:

有以下主要的五个组成部分的系统总时间的推移:

组件 描述
User state CPU The actual amount of time the CPU spends running the users program in the user state. It includes time spent executing library calls, but does not include time spent in the kernel on its behalf.
System state CPU This is the amount of time the CPU spends in the system state on behalf of this program. All I/O routines require kernel services. The programmer can affect this value by the use of blocking for I/O transfers.
I/O Time and Network Time These are the amount of time spent moving data and servicing I/O requests
Virtual Memory Performance This includes context switching and swapping.
Application Program Time spent running other programs - when the system is not servicing this application because another application currently has the CPU.

性能工具:

UNIX提供了重要的工具来测量和微调Unix系统的性能:

命令 描述
nice/renice Run a program with modified scheduling priority
netstat Print network connections, routing tables, interface statistics, masquerade connections, and multicast memberships
time Time a simple command or give resource usage
uptime System Load Average
ps Report a snapshot of the current processes.
vmstat Report virtual memory statistics
gprof Display call graph profile data
prof Process Profiling
top Display system tasks

您可以使用联机帮助帮助这里提到的每个命令的语法检查完成。