如何在Linux中找到处理器队列长度 [英] How to find the processor queue length in linux

查看:313
本文介绍了如何在Linux中找到处理器队列长度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图确定linux机器上的处理器队列长度(准备运行但当前尚未运行的进程数). Windows中有一个针对此指标的WMI调用,但对Linux知之甚少,因此我试图挖掘/proc和"top"作为信息.有没有办法确定CPU的队列长度?

Trying to determine the Processor Queue Length (the number of processes that ready to run but currently aren't) on a linux machine. There is a WMI call in Windows for this metric, but not knowing much about linux I'm trying to mine /proc and 'top' for the information. Is there a way to determine the queue length for the cpu?

编辑以添加:Microsoft关于其度量标准的字眼:一个或多个已准备好但由于当前正在运行的另一个活动线程而无法在处理器上运行的线程的集合称为处理器队列.

Edit to add: Microsoft's words concerning their metric: "The collection of one or more threads that is ready but not able to run on the processor due to another active thread that is currently running is called the processor queue."

推荐答案

sar -q将报告队列长度,任务列表长度和三个平均负载.

sar -q will report queue length, task list length and three load averages.

示例:

matli@tornado:~$ sar -q 1 0
Linux 2.6.27-9-generic (tornado)    01/13/2009  _i686_

11:38:32 PM   runq-sz  plist-sz   ldavg-1   ldavg-5  ldavg-15
11:38:33 PM         0       305      1.26      0.95      0.54
11:38:34 PM         4       305      1.26      0.95      0.54
11:38:35 PM         1       306      1.26      0.95      0.54
11:38:36 PM         1       306      1.26      0.95      0.54
^C

这篇关于如何在Linux中找到处理器队列长度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆