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?
5 Answers
Run the 'top' command and press '1' to see the individual cores.
-
5great! But how can I save the command result into a file periodically by running a script? You know, you can't press a key in a script. Is there any 'top' option available to turn on this feature?– snowfoxMay 18, 2012 at 8:47
-
@snowfox: you can press W (capitalized) when running
top
to save the current state.– YnhockeyDec 30, 2015 at 9:32
When runnging the top
command, press f
then j
to display the P column (last CPU used by process), in addition to the 1
command in top, you should view some multi core occupation informations :)
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.
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