LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   CentOS (https://www.linuxquestions.org/questions/centos-111/)
-   -   CentOS: Increase CPU load on all 56 cores simultaneously to >90% (https://www.linuxquestions.org/questions/centos-111/centos-increase-cpu-load-on-all-56-cores-simultaneously-to-90-a-4175655158/)

iambhamsaa 06-04-2019 08:53 PM

CentOS: Increase CPU load on all 56 cores simultaneously to >90%
 
Hi All

I am using CentOS 7. I am trying to increase load as part of cpu load testing. however seems that whenever i do that it uses few cores only.
Please help what is the best way to increase load on all CPU cores simultaneously. Whats the command and how to see (top).

Thanks
Kj

berndbausch 06-04-2019 11:07 PM

If you have 56 cores:
Code:

for i in {1..56}
do
  while :
  do :
  done &
done

The colon is an alias for the true command. You may have to run more than 56 of these.

top is indeed a nice tool to view CPU load. You can also use vmstat or sar.

onebuck 06-05-2019 08:18 AM

Moderator Response
 
Moved: This thread is more suitable in <CentOS> and has been moved accordingly to help your thread/question get the exposure it deserves.

dc.901 06-05-2019 01:29 PM

Sometime ago, I've used utility called "stress"...
https://www.cyberciti.biz/faq/stress...ith-stress-ng/

MensaWater 06-05-2019 02:37 PM

The funny thing is that on Linux CPU "load" doesn't really seem to be a good measure of performance like it was on UNIX. On UNIX if I had a load greater than 1 on all my CPUs performance was degraded. If it ever got to 2 UNIX would seem almost to have stopped. On Linux however I've seen incredible load values (e.g. 32) without having complaints about performance. It is only when "busy" goes to more than 95% (and idle to less than 5%) that I see Linux systems having obvious performance issues.

Due to that I've been wanting another way to determine CPU utilization for monitoring. Since "busy" and "idle" are point in time rather than cumulative over time like load (5, 10 and 15 minutes) there doesn't seem to be an easy way to capture this. I'd have to script something that got values and average them but even that sounds kludgey.

syg00 06-05-2019 05:52 PM

Be careful what you wish for @MensaWater ... :p
Have a read of this for more than you ever wanted to know. I've been following Brendan for years - good stuff.

berndbausch 06-05-2019 06:58 PM

Quote:

Originally Posted by syg00 (Post 6002583)
Be careful what you wish for @MensaWater ... :p
Have a read of this for more than you ever wanted to know. I've been following Brendan for years - good stuff.

In UNIX, load averages are calculated from the number of runnable processes and processes waiting for disk I/O (the non-interruptable processes mentioned in Brendan's article - non-interruptable means "disk i/o" for almost all purposes). Linux seems to define that value exactly the same. For an attempt to cram "system load" into a single number, the load average seems to have been rather useful over the years.

Now the OP wants raw CPU usage, so that load average is not a good metric here.

syg00 06-05-2019 07:00 PM

Quote:

Originally Posted by berndbausch (Post 6002598)
In UNIX, load averages are calculated from the number of runnable processes and processes waiting for disk I/O

It might now, but didn't originally.

MensaWater 06-06-2019 12:10 PM

Quote:

Originally Posted by syg00 (Post 6002583)
Be careful what you wish for @MensaWater ... :p
Have a read of this for more than you ever wanted to know. I've been following Brendan for years - good stuff.

Thanks for sharing that. It confirms what I've seen on Linux and explains WHY I see it. It even gives suggestions for tools that might more accurately reflect just CPU load as opposed to overall system load.

273 06-06-2019 12:50 PM

Sorry if I'm reading this wrong but to "load up" my CPU for cooling testing and the like I find that Prime95 in the shape of mprime will do a pretty good job.


All times are GMT -5. The time now is 04:51 AM.