使用sar -q查看等待运行的任务数量(runq-sz)和系统负载情况(ldavg-1,ldavg-5,ldavg-15)

本文介绍如何使用sar-q命令查看Linux系统的任务队列长度和负载平均值,并解释这些指标的意义及如何判断系统性能是否正常。

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

[root@abc ~]# man sar

       -q     Report queue length and load averages. The following values are displayed:
              runq-sz
                     Run queue length (number of tasks waiting for run time).
              plist-sz
                     Number of tasks in the task list.
              ldavg-1
                     System load average for the last minute.  The load average is calculated as the average number of runnable or running tasks (R state), and the number of tasks in unin-
                     terruptible sleep (D state) over the specified interval.
              ldavg-5
                    System load average for the past 5 minutes.
              ldavg-15
                     System load average for the past 15 minutes.

[root@abc ~]# sar -q  1 10
Linux 2.6.32-642.el6.x86_64 (abc) 	06/06/2018 	_x86_64_	(4 CPU)


11:39:51 AM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
11:39:52 AM         0       291      0.12      0.09      0.06
11:39:53 AM         0       291      0.11      0.09      0.06
11:39:54 AM         0       291      0.11      0.09      0.06
11:39:55 AM         0       291      0.11      0.09      0.06
11:39:56 AM         0       291      0.11      0.09      0.06
11:39:57 AM         0       291      0.11      0.09      0.06
11:39:58 AM         0       291      0.10      0.09      0.06
11:39:59 AM         0       291      0.10      0.09      0.06
11:40:00 AM         1       291      0.10      0.09      0.06
11:40:01 AM         0       291      0.10      0.09      0.06
Average:            0       291      0.11      0.09      0.06
[root@abc ~]# 
typically a system's load should remain at 70% of the number of cores or lower. 
If the system's load is consistently above this amount there may be performance degradation, 
and if the load ever rises above the number of cores there will be a significant slowdown.
如上摘自:https://access.redhat.com/articles/325783
How to analyze and interpret sar data.

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值