Testing SYSTEM average load on CentOS 64 bits with 4 cores

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Testing SYSTEM average load on CentOS 64 bits with 4 cores

Post by jcasares »

I'm using the test for SYSTEM average load on a CentOS x64 with 2 virtual CPUs with 2 COREs but I get weird values. I get loads of 270% ?!

Is that right?
I'm doing something wrong with the test?
Shouldn't that be between 0% and 100%

This is the result of the uptime command:

Code: Select all

[root@server ~]# uptime
 18:29:34 up 156 days,  1:29,  2 users,  load average: 1.57, 1.86, 2.12
And this is mpstat:

Code: Select all

[root@server ~]# mpstat
Linux 2.6.32-358.el6.x86_64 (server)     02/27/2014      _x86_64_        (4 CPU)

06:32:57 PM  CPU    %usr   %nice    %sys %iowait    %irq   %soft  %steal  %guest   %idle
06:32:57 PM  all    8.05    0.00   16.67    0.65    0.00    0.37    0.00    0.00   74.26
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor uses vmstat
-----
vmstat -n 1 2 | tail -1 | awk '{ if (NF==17) {print $(NF-4)+$(NF-3)} else {print $(NF-3)+$(NF-2)}}';;
-----
What version of this utility installed on your system?

Regards
Alex
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

This is the version that has this server:

Code: Select all

[root@server ~]# vmstat -V
procps version 3.2.8
And this the result of the command:

Code: Select all

[root@server ~]# vmstat
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu-----
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 9  0 521992 322344 332780 5042860    0    0     1    50    1    1  8 17 74  1  0
And this is what I have for code on "SYSTEM: Average Load for the past 5 min"

Code: Select all

#!/bin/sh
if [ $# -ge 1 ]
then
  uptime | awk '{load=substr($(NF-1),1,4)*100; if (load>'$1') {printf("ScriptRes:Bad:%d\n",load)} else {printf("ScriptRes:Ok:%d\n",load)}; exit;}'
else
  echo 'ScriptRes:Unknown:not enough parameters specified'
fi
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

I'm using the test for SYSTEM average load on a CentOS x64 with 2 virtual CPUs with 2 COREs but I get weird values. I get loads of 270% ?!
Oh, sorry, I was thinking about CPU Usage test method.
You have 4 CPU cores so you may see load up to 400 (200 is 50% load for your system)

Regards
Alex
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

Ok, I got it. Thanks!
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

We need to follow up this issue as We're getting values up to 2000 when we have only 4 cores.

Image

Any idea on why we're getting this values?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is good article
http://blog.scoutapp.com/articles/2009/ ... d-averages
A single-core CPU is like a single lane of traffic. Imagine you are a bridge operator ... sometimes your bridge is so busy there are cars lined up to cross.
...
over 1.00 means there's backup. How much? Well, 2.00 means that there are two lanes worth of cars total -- one lane's worth on the bridge, and one lane's worth waiting. 3.00 means there are three lane's worth total -- one lane's worth on the bridge, and two lanes' worth waiting. Etc.

This is basically what CPU load is. "Cars" are processes using a slice of CPU time ("crossing the bridge") or queued up to use the CPU. Unix refers to this as the run-queue length: the sum of the number of processes that are currently running plus the number that are waiting (queued) to run.

Like the bridge operator, you'd like your cars/processes to never be waiting. So, your CPU load should ideally stay below 1.00. Also like the bridge operator, you are still ok if you get some temporary spikes above 1.00 ... but when you're consistently above 1.00, you need to worry.
In your case (4 cores, HM multiplies by 100, 4x100=400) "2000" returned by script means - in order to process commands from all running processes on the system CPU must be 5 times faster.

Regards
Alex
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

That makes sense. Thanks for the prompt reply.
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

Sorry to bother you again but something doesn't add. Even when the alarm of system load is giving me these numbers that are supposed to be showing all cores are in use and I should need more I get 60~760% average CPU usage while monitoring with another solution (VMware performance metrics).

What it's happening? Is there any other CPU test I can use that shows CPU usage for the server (not a process) instead of load?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

There is CPU Usage test method, by default it uses vmstat and shows current CPU usage percentage (up to 100%)

Regards
Alex
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

I can't see that option. Something wrong with our installation?

Image
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

This is Script Manager, used with Shell Script test method.
You need CPU Usage test method:
http://www.ks-soft.net/hostmon.eng/mfra ... m#cpuUsage
jcasares
Posts: 52
Joined: Tue Sep 16, 2008 9:33 am

Post by jcasares »

Ok, I thought that this feature was for Windows only because when you set it the dialog says OS Windows.

Image

Thank you for the information. :)
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
Post Reply