本博文的主要内容有
.系统内存管理、监控:vmstat和free -mt
.系统CPU管理、监控:sar -u、mpstat、uptime
linux系统内存和CPU是在系统运行的过程中不断消耗的资源,其随系统进程的不断增加而减少,并在进程关闭后会回收有些资源。通过对系统内存和CPU使用率的监控,就能给了解linx系统当前的“繁忙”程序。
1、系统内存管理、监控:vmstat和free -mt
在linux系统中,内存分为物理内存和虚拟内存。
物理内存是真实存在的,即存在内存条上。
虚拟内存,称为交换分区。
在linux系统,用vmstat,即Virtual Memory Statistics,虚拟内存统计命令。
[root@weekend110 ~]# man vmstat
VMSTAT(8) Linux Administrator’s Manual VMSTAT(8)
NAME
vmstat - Report virtual memory statistics
SYNOPSIS
vmstat [-a] [-n] [-t] [-S unit] [delay [ count]]
vmstat [-s] [-n] [-S unit]
vmstat [-m] [-n] [delay [ count]]
vmstat [-d] [-n] [delay [ count]]
vmstat [-p disk partition] [-n] [delay [ count]]
vmstat [-f]
vmstat [-V]
DESCRIPTION
vmstat reports information about processes, memory, paging, block IO, traps, and cpu activity.
The first report produced gives averages since the last reboot. Additional repor