How can I see how many processor cores are working?
I have quad-core processor system. I was using Windows before installing Ubuntu. Windows by-default was using 1 core* and I could change that with
msconfig. How can I do this in Ubuntu or is it necessary?
Windows was using one core for booting.
I feel it's important to note that Windows wasn't only using one core. The entry in MSConfig is talking about how many cores it should use in the booting process, and I'm fairly sure it's only useful to *limit* that number. I see no reason why it wouldn't use all of them by default.
You can see the usage of your CPU cores using top command.
- Open a Terminal.
top. You will see some information about tasks, memory etc.
1to show individual CPU usage. You will see something like:
To start a new process which should execute only in one core, you can use taskset command.
taskset -c 0 executable
To monitor the existing process's CPU affinity, you can use this command:
taskset -cp $(pgrep -f executable)
note that the executable identity you will pass to this command can be './executable' if you started it that way.
This is a good answer, because it makes use of the top command which we always use anyway. I also never knew about taskset.
As you have not specified your Desktop environment I will assume you are using Using Ubuntu
For a graphical way to check your cpu usage, search your system for an application called System monitor.
The Resources tab will show activity of each core
Whilst the Processes tab will show cpu usage for individual programmes.
htoptool provides graphs for cpu core(s) usage
install htop via terminal:
apt-get install htop
run htop via terminal:
I recommend expanding this to explain how to use it for that purpose and to show what it looks like (when used this way).
You have not even mentioned how to install it, as it doesn't come with the system.