CPU utilization question

A forum for discussing FAH-related hardware choices and info on actual products (not speculation).

Moderator: Site Moderators

Forum rules
Please read the forum rules before posting.
Post Reply
vesprini@gmail.com
Posts: 11
Joined: Tue Sep 20, 2016 5:22 pm

CPU utilization question

Post by vesprini@gmail.com »

hello

sorry if this is the wrong forum for this, please redirect if so....

Ive been a long time user and am looking to build a new computer mostly for running FAH. On my current 4 core 8 thread system i split 50% of the processing power for FAH and 50% for World community grid and let my computer run 24/7. I notice when just FAH is running and I look at the the activity of each core and thread that the actual CPU load is not restricted to to just 2 cores and 4 threads (ie 50% of CPU), but instead it is spread out over all cores/threads so that the total usage averages to ~50% of total CPU power. In other words I would have expected to see 2 cores/4 threads at 100% usage and 2 other cores/4 threads at 0%, but instead all 4 cores/8 threads are partially used and highly variable in their % usage second by second...but the average overall cpu usage is 50%. is there something i can do such that specific cores are utilized 100% and others are left untouched? would that not be more efficient rather than shuffling things between cores/threads? I ask because i was planning to build a new computer with even more cores/threads to run FAH and bonic. thanks very much for your time.

nick
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: CPU utilization question

Post by bruce »

The OS decides which task gets assigned to which available resource. There is no reason to choose one CPU over any other so you'll get the results you've reported. Why would you expect it to use 100% of two CPUs rather than 50% each of 4 CPUs?

When FAH is allocated 4 CPUs, it will start 4 parallel tasks so it won't exceed a TOTAL of 50% (well, maybe with overhead, it might be vary slightly up or down).

Yes, there's something you can do, by researching a topic called "affinity" but with it or without it will take the use the same amount of electricity, produce the same amount of heat, and and complete the same amount of work within the accuracy range of your measuring tools. Setting affinity will restrict an active task from using any except the authorized CPU(s). Your OS will do it's best to accomodate those extra restrictions.

Since your CPU is making use of HyperThreading, the hardware will continue to manage resources for a pair of threads, stealing some processing power from the other half of the pair whenever it's expeditious to do so and I doubt that that will show up on your monitoring tools.
vesprini@gmail.com
Posts: 11
Joined: Tue Sep 20, 2016 5:22 pm

Re: CPU utilization question

Post by vesprini@gmail.com »

thank you for the info!

my concern was that the "shuffling" around of the various threads consumes unnecessary computation/management. If i watch the activity of each thread its highly volatile, large momentary spikes, then minimal activity, then some mid level activity, etc. At the same time each of the other threads compensates (eg if one thread is at 100% two or three other threads drop in utilization) so that total cpu use is at ~50%. This alone seems as though the software or OS is "shuffling" things around to balance and when in combination with other software, makes things harder to manage and so i thought this might not be as efficient in processing. ie managing 4 parallel tasks across 8 threads which are continually changing in utilization and thus need other threads to be more or less active to compensate for each other.....all while maintaining the 50% limit and possibly running other software that also requires compute resources seems unnecessarily complicated.

if there isnt substantial resource/compute loss from this "shuffling" then im totally fine with it. just seems like the OS is doing an awful lot of micromanagement and that keeping things isolated to specific cores would be simple/easy.
bruce
Posts: 20910
Joined: Thu Nov 29, 2007 10:13 pm
Location: So. Cal.

Re: CPU utilization question

Post by bruce »

There will be those who contend that manually managing affinity can improve cache managment enough to be worth the effort, even-though it's small enough to make it very difficult to measure. IMHO, measurable effects are limited to large systems with many discrete CPUs, perhaps with separate memory banks. For the typical home-based system with a single CPU chip sharing a single memory image, it would be a wasted effort.

Modern operating systems do a very good job of managing multiple tasks. The the instants that the scheduler needs to allocate resources to a task that has been waiting for I/O, it compares a list of tasks that need resources with the list of processors that are idle and assigns one. If all processes are busy, it considers the priority of the new task together with that of the tasks that are already receiving processing resources and it chooses the lowest priority task to do the waiting except if that task has been locked out for "too long" or if memory allocation is a problem.

CPU scheduling algorithms have had many, many years of incremental improvements and they've become quite sophisticated.
Post Reply