Saturday, August 15, 2009

Detect and monitor CPU cores

If you have several CPUs on your system or multicore CPU, you can detect number of cores with this simple command:

$ cat /proc/cpuinfo | grep processor | wc -l

To determine the usage of each core you can use standard top command. By default it shows only summary usage, however you can toggle between summary and per core usage with the '1' key after starting the top.

1 comment:

  1. A hyperthreading cpu will show as two processors in cpuinfo, although it has only 1 core.