LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS
User Name
Password
CentOS This forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.

Notices


Reply
  Search this Thread
Old 06-04-2019, 08:53 PM   #1
iambhamsaa
LQ Newbie
 
Registered: Jun 2019
Posts: 1

Rep: Reputation: Disabled
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
 
Old 06-04-2019, 11:07 PM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
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.
 
Old 06-05-2019, 08:18 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,923
Blog Entries: 44

Rep: Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158Reputation: 3158
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.
 
Old 06-05-2019, 01:29 PM   #4
dc.901
Senior Member
 
Registered: Aug 2018
Location: Atlanta, GA - USA
Distribution: CentOS/RHEL, openSuSE/SLES, Ubuntu
Posts: 1,005

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
Sometime ago, I've used utility called "stress"...
https://www.cyberciti.biz/faq/stress...ith-stress-ng/
 
Old 06-05-2019, 02:37 PM   #5
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
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.
 
Old 06-05-2019, 05:52 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Be careful what you wish for @MensaWater ...
Have a read of this for more than you ever wanted to know. I've been following Brendan for years - good stuff.
 
1 members found this post helpful.
Old 06-05-2019, 06:58 PM   #7
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by syg00 View Post
Be careful what you wish for @MensaWater ...
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.
 
Old 06-05-2019, 07:00 PM   #8
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,119

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by berndbausch View Post
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.
 
1 members found this post helpful.
Old 06-06-2019, 12:10 PM   #9
MensaWater
LQ Guru
 
Registered: May 2005
Location: Atlanta Georgia USA
Distribution: Redhat (RHEL), CentOS, Fedora, CoreOS, Debian, FreeBSD, HP-UX, Solaris, SCO
Posts: 7,831
Blog Entries: 15

Rep: Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669Reputation: 1669
Quote:
Originally Posted by syg00 View Post
Be careful what you wish for @MensaWater ...
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.
 
Old 06-06-2019, 12:50 PM   #10
273
LQ Addict
 
Registered: Dec 2011
Location: UK
Distribution: Debian Sid AMD64, Raspbian Wheezy, various VMs
Posts: 7,680

Rep: Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373Reputation: 2373
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.
 
1 members found this post helpful.
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get physical CPU count, cores per CPU, and CPU type on RHEL and CentOS anon091 Linux - Server 7 01-08-2015 10:57 AM
AMD Cores/Threads/Virtual Cores dman777 Linux - Hardware 2 05-07-2013 02:04 AM
[SOLVED] Control of CPU cores utilization on centos server, is it possible? Alan_SP Linux - Server 15 11-13-2012 05:17 AM
[SOLVED] Are all of my CPU-cores working? Weapon S Linux - Hardware 6 02-04-2012 09:32 AM
How many CPU, cores/CPU? pcotten Linux - General 5 01-20-2011 09:34 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > CentOS

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration