[Solved] Mint 17 64bits - Shouldn't it use the CPU better?

Questions about hardware, drivers and peripherals
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
BrunoMiranda
Level 4
Level 4
Posts: 359
Joined: Thu Jun 24, 2010 2:22 pm

[Solved] Mint 17 64bits - Shouldn't it use the CPU better?

Post by BrunoMiranda »

Hi all,

I'm compressing a big folder into a tar.bz2 file, it's taking a long time. I'm using Mint17's (64 bits) native compression utility (with the GUI).

I've checked the CPU performance, and it's only using one thread from one core at a time, and it keeps on switching from one to another instead of using all the cores at the same time to maximize performance. In this case, it could mean saving me a few hours...

I've realized when I'm using CPU intensive software, I've never seen all the cores being fully used at the same time.



Here's the CPU info:
sudo inxi -C
CPU: Dual core Intel Core i3-3217U CPU (-HT-MCP-) cache: 3072 KB flags: (lm nx sse sse2 sse3 sse4_1 sse4_2 ssse3 vmx) Clock Speeds: 1: 1600.00 MHz 2: 774.00 MHz 3: 1801.00 MHz 4: 1801.00 MHz

Here's the kernel info:
uname -a
Linux acer 3.13.0-34-lowlatency #60-Ubuntu SMP PREEMPT Wed Aug 13 16:15:18 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux

Here's the memory info:
free -h
-------- total used free shared buffers cached
Mem: 7,7G 7,6G 134M 245M 18M 6,3G
-/+ buffers/cache: 1,3G 6,4G
Swap: 7,8G 0B 7,8G


Here's the CPU history graph:
https://db.tt/8L2wmLvz



:?: So, questions, questions... :?:

- Why isn't Mint using full CPU power?

- Why (as shown in the graph with the link down below) are the several cores and threads switching among themselves? Inappropriate kernel? To avoid overheating? Or have they implemented an Anarchist way of dealing with power in a rotational way? :lol:

- On the inxi -C command, this info
Clock Speeds: 1: 1600.00 MHz 2: 774.00 MHz 3: 1801.00 MHz 4: 1801.00 MHz
could it mean that all the 4 threads are actually being well enough used?
If so, why is it mismatching the info on the CPU graph? Could the text info be just a snapshot in time and not the average use?

- Is there a way I can configure the OS or the compression tool to use all the CPU power?



Any idea, guys? Thanks!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Bye for now,
Bruno


(Always backup before you screw up :)
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by all41 »

maybe a matter of perception..

Code: Select all

sudo apt-get install sysstat
or use Synaptic

then

Code: Select all

mpstat -P ALL 1
Everything in life was difficult before it became easy.
BrunoMiranda
Level 4
Level 4
Posts: 359
Joined: Thu Jun 24, 2010 2:22 pm

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by BrunoMiranda »

Hi all41, and thanks for your kind reply!

As the compressing job is not over yet, I could take another sample of the same program running under the same conditions.
Well, I guess the sysstat info matches the graphical one. It seems the CPU is not being used full power. :?

The printscreen is here:
https://db.tt/hdpN2RxZ
Bye for now,
Bruno


(Always backup before you screw up :)
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by all41 »

just for fun I will put a quad core to the task of compressing a partition image and observe this---TOMORROW
Best your way
Everything in life was difficult before it became easy.
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by all41 »

Bruno,
I am observing the same result as you have reported.
The computer I used also has an additional hd with Win7,
so I will look at how Win7 reports core utilization and post my observations--

Well just did that and the Win7 perfmon shows nearly identical results--
even core swapping and sometimes idle cores that you mentioned.
Everything in life was difficult before it became easy.
Buzzsaw
Level 6
Level 6
Posts: 1318
Joined: Sat Aug 23, 2014 12:53 pm

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by Buzzsaw »

Whether a program uses only one core or more than one core when available, is determined by the program's developer(s).

As far as I know, there's no way to make a program use more than one core if it isn't written to use more than one core. I use GIMP and Firefox regularly on a dual-core computer, and the total CPU use only goes to 50% maximum, so both those, and many other programs are still only single-threaded.
BrunoMiranda
Level 4
Level 4
Posts: 359
Joined: Thu Jun 24, 2010 2:22 pm

Re: Mint 17 64bits - Shouldn't it use the CPU better?

Post by BrunoMiranda »

I am observing the same result as you have reported.
(...)
Well just did that and the Win7 perfmon shows nearly identical results--
even core swapping and sometimes idle cores that you mentioned
All41,
Nice observations. Thanks once more!



Whether a program uses only one core or more than one core when available, is determined by the program's developer(s).
(...)
many other programs are still only single-threaded.
Buzzsaw,
You are right and this seems to be the case.

I've done a test wit the stress command and measured it with mpstat, and the stress is done under all threads of all cores of the CPU (see a printscreen in the link below).

First, I've installed stress:

Code: Select all

sudo apt install stress
Then ran the stress command on 4 CPUs (please read 4 threads from 2 cores) for 4 seconds:

Code: Select all

stress -v --cpu 4 --io 4 --vm 2 --vm-bytes 128M --timeout 4s
The printscreen with the link below was obtained by running:
mpstat -P ALL 1



The mpstat printscreen is here:

https://db.tt/UX31X5KL



Interpretation:
If you focus on the most right collumn (the %idle, and you read it from top to bottom), you will see that before the stress command, the top values (with %idle value around 70 or 80 something) mean that the CPU wasn't being under heavy use. But when I ran the stress command (for 4 seconds) the %idle values went down to zero on all 4 threads on all 4 cores - full CPU use. After these 4 seconds, the CPU went back to a relaxed state again with no heavy load on it.


So this means that the hardware, the OS and the software all together on my system can take full use of the CPU, if the software has been written to it - as Buzzsaw as written.

It seems software developers should start thinking in implementing multithreading on their software if it is CPU intensive, since it seems multithreading is a standard for most modern CPUs. This would bring a great boost on their programs' performance! :D

Case closed :mrgreen: , thanks all41 and buzzsaw for your help!
Bye for now,
Bruno


(Always backup before you screw up :)
Locked

Return to “Hardware Support”