Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Linux cpu 使用的 psutil 和 sar 有什么区别?例如,我想知道哪些资源和计算。
psutil(进程和系统实用程序) - 是一个跨平台库,用于在 Python 中检索有关正在运行的进程和系统利用率(CPU、内存、磁盘、网络、传感器)的信息。它主要用于系统监控、分析和限制进程资源以及管理正在运行的进程。
SAR(System Activity Report) - 用于收集、报告和保存类 Unix 操作系统中的 CPU、内存、I/O 使用情况。SAR 命令即时生成报告,也可以将报告保存在日志文件中。