系统内存和CPU管理、监控

本文详细介绍了Linux系统中用于监控内存和CPU的工具,包括vmstat、free -mt命令来监测内存使用情况,以及sar -u、mpstat、uptime来跟踪CPU活动。通过这些工具,可以实时了解系统资源的占用状况,帮助优化系统性能。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

 本博文的主要内容有

  .系统内存管理、监控: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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值