当前位置: 首页 > 工具软件 > sysstat > 使用案例 >

sysstat使用及字段说明

张丁雷
2023-12-01

sysstat使用

参考sysstat的man手册



前言

介绍sysstat的常用命令,以及各字段含义


一、sysstat是什么?

github: link
sysstat包 包含许多商业 Unix 通用的各种实用程序,用于监控系统性能和使用活动

sar是系统活动报告器。通过解释 sar 生成的报告,可以定位系统瓶颈并针对这些烦人的性能问题提出一些可能的解决方案。Linux 内核维护内部计数器,用于跟踪请求、完成时间、I/O 块计数等。根据这些信息和其他信息,sar 计算速率和比率,从而深入了解瓶颈所在。

sadf -d 以关系数据库可以轻松获取的格式提取数据。
pidstat命令用于监控当前由 Linux 内核管理的进程和线程。它还可以监视那些进程和线程的子进程。

二、常用命令

1.监控cpu

命令如下(示例):

import numpy as np

2.监控内存

命令如下(示例):

import numpy as np

三、字段说明

1. cpu相关

2. memory相关

字段名含义
kbmemfreeAmount of free memory available in kilobytes.
kbavailEstimate of how much memory in kilobytes is available for starting new applications, without swapping.The estimate takes into account that the system needs some page cache to function well, and that not all reclaimable slab will be reclaimable, due to items being in use. The impact of those factors will vary from system to system.
kbmemusedAmount of used memory in kilobytes (calculated as total installed memory - kbmemfree - kbbuffers - kbcached - kbslab).
%memusedPercentage of used memory.
kbbuffersAmount of memory used as buffers by the kernel in kilobytes.
kbcachedAmount of memory used to cache data by the kernel in kilobytes.
kbcommitAmount of memory in kilobytes needed for current workload.This is an estimate of how much RAM/swap is needed to guarantee that there never is out of memory.
%commitPercentage of memory needed for current workload in relation to the total amount of memory (RAM+swap). This number may be greater than 100% because the kernel usually overcommits memory.
kbactiveAmount of active memory in kilobytes (memory that has been used more recently and usually not reclaimed unless absolutely necessary).
kbinactAmount of inactive memory in kilobytes (memory which has been less recently used. It is more eligible to be reclaimed for other purposes).
kbdirtyAmount of memory in kilobytes waiting to get written back to the disk.

总结

提示:这里对文章进行总结:

例如:xxx。

 类似资料: