在 linux 上查看多核或 mlti-cpu 使用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5899227/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 00:49:46  来源:igfitidea点击:

view multi-core or mlti-cpu utlization on linux

linuxmulticore

提问by user678070

I have a program running on Linux and I need to determine how it is utilizing all the CPUs/cores. Is there any program for viewing this information?

我有一个在 Linux 上运行的程序,我需要确定它是如何利用所有 CPU/内核的。有什么程序可以查看这些信息吗?

采纳答案by Cédric Julien

When runnging the topcommand, press fthen jto display the P column (last CPU used by process), in addition to the 1command in top, you should view some multi core occupation informations :)

运行top命令时,按fthenj显示 P 列(进程使用的最后一个 CPU),除了1顶部的命令,您还应该查看一些多核占用信息:)

回答by Reto Aebersold

Run the 'top' command and press '1' to see the individual cores.

运行“ top”命令并按“ 1”查看各个内核。

回答by Stefan Endrullis

htopshows you the cpu usage of each core in a graphical manner (ncurses).

htop以图形方式(ncurses)向您显示每个内核的 CPU 使用率。

回答by Ralph Byrd

mpstat -P ALL 5 5 >>your.file

mpstat -P ALL 5 5 >>your.file

You may need to parse this to use it for a presentation, or sum it But read the man page as mpstat has some useful options.

您可能需要对其进行解析以将其用于演示,或者对其进行总结 但请阅读手册页,因为 mpstat 有一些有用的选项。

回答by Atul Singh Rajpoot

Run the 'top' command and press '1' to see the individual core is the best way to see the cpu cores usage .. another option is run cmd- cat /proc/stat to see the cpu cores usage

运行“top”命令并按“1”查看单个内核是查看 cpu 内核使用情况的最佳方法..另一个选项是运行 cmd-cat /proc/stat 以查看 cpu 内核使用情况