sysstat服务说明
sysstat 服务(/etc/init.d/sysstat)负责定期收集系统性能信息。
通过使用 cron 和 sadc(系统活动数据收集器),sysstat 每天每隔 10 分钟收集一次 sar 数据 (/var/log/sa/)。
该服务对整体服务器性能几乎没有影响。
默认的 sysstat 配置 (/etc/sysconfig/sysstat) 每 7 天覆盖一次收集的性能信息。
Sysstat 作为 sysstat 包的一部分提供,它还提供有用的系统性能收集实用程序,包括; mpstat、iostat 和 sar 。
欢迎来到之路教程(on itroad-com)
配置
默认的 sysstat 配置文件是 /etc/sysconfig/sysstat 。
下面是示例配置文件。
# cat /etc/sysconfig/sysstat # sysstat-9.0.4 configuration file. # How long to keep log files (in days). # If value is greater than 28, then log files are kept in # multiple directories, one for each month. HISTORY=28 # Compress (using gzip or bzip2) sa and sar files older than (in days): COMPRESSAFTER=31 # Parameters for the system activity data collector (see sadc bananaal page) # which are used for the generation of log files. SADC_OPTIONS="-S DISK" # Compression program to use. ZIP="bzip2"
默认的 sysstat cron 选项卡文件是 /etc/cron.d/sysstat 。
示例 cron 文件如下所示。
# cat /etc/cron.d/sysstat # Run system activity accounting tool every 10 minutes */10 * * * * root /usr/lib64/sa/sa1 1 1 # 0 * * * * root /usr/lib64/sa/sa1 600 6 & # Generate a daily summary of process accounting at 23:53 53 23 * * * root /usr/lib64/sa/sa2 -A
日期:2020-09-17 00:14:39 来源:oir作者:oir