Server Load

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Server Load

Post by s.dot »

What exactly is Server Load?

Im using cPanel and normally it's around 0.33 (2 cpus)
however today I got around 600 people on my server (one time thing) and this shot up to 20.06 and was flashing a red dot

then it got down to around 6 and was still flashing red (so 20 must be really bad! d'oh)

what does it mean? what happens if it gets too high?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Re: Server Load

Post by Roja »

scrotaye wrote:What exactly is Server Load?
Its a measure of how hard the cpu is working. It is a percentage of use, so at 0.33, the cpu is 33% busy. When it is over 1.0, its a bad thing, with instructions queued up. At 20.06, you have 2000% utilization, and every second that a new instruction begins, it has to wait 20 seconds for that action to actually begin.
scrotaye wrote:what happens if it gets too high?
Depending on the OS, and the setting, eventually the server will start disabling non-critical services like Mail, or even DNS. If that doesn't fix the problem, eventually the machine may freeze up, or reboot.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

so since i have 2 cpus do I divide this number in half?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

scrotaye wrote:so since i have 2 cpus do I divide this number in half?
It depends on how they are presenting the data. Usually, if its multi-cpu, its still the % across both (total cpu load), not per-cpu.

Although I have seen a web-based panel that shows it per-cpu. Put another way, I'm not sure (pun intended).
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

well what makes up the server load... is it the combined specs of the server? and what's a good server load number to shoot for

right now its 1.36 and the dot is still green, so I guess that's OK
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

scrotaye wrote:well what makes up the server load... is it the combined specs of the server? and what's a good server load number to shoot for

right now its 1.36 and the dot is still green, so I guess that's OK
Anything below 1.0 (100% use) is good. Ideally, you want it to *always* be below 100%, even during high-volume, which means you probably want the average to be far below 0.50.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

I've seen scripts/apps that alert you when it gets quite high (say 5.0 for example).
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

The server load figure within cPanel is probably taken from the load averages.

The load average figures are not a direct representation of CPU utilization, I've actually taken two snapshots today of the load average on one of my servers, the results of which were....

Code: Select all

1:57pm  up 23:41,  1 user,  load average: 3.09, 3.10, 3.06
162 processes: 158 sleeping, 4 running, 0 zombie, 0 stopped
CPU0 states: 62.2% user, 19.0% system,  0.0% nice, 18.1% idle
CPU1 states: 62.2% user, 21.3% system,  0.0% nice, 15.3% idle
Mem:  1030664K av,  865864K used,  164800K free,       0K shrd,  107904K buff
Swap: 2096440K av,  149724K used, 1946716K free                  581664K cached
And...

Code: Select all

8:01pm  up 1 day,  5:46,  1 user,  load average: 2.91, 2.44, 2.83
137 processes: 133 sleeping, 3 running, 1 zombie, 0 stopped
CPU0 states: 76.2% user, 23.2% system,  0.0% nice,  0.0% idle
CPU1 states: 61.4% user, 32.0% system,  0.0% nice,  5.4% idle
Mem:  1030664K av,  972916K used,   57748K free,       0K shrd,  100344K buff
Swap: 2096440K av,   79292K used, 2017148K free                  687652K cached
As you can see, the first one is showing higher load averages but less CPU utilization. Personally I tend to look more at the idle figures than load averages as a representation of how hard the server is working.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

meh for some reason I don't believe this number half the time

ie it says 6.32 right now, yet my website is as fast as ever =/
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

redmonkey wrote:The load average figures are not a direct representation of CPU utilization
This is where definitions play a big part in determining accuracy.

CPU load is the number of CPU cycles divided by the total number of active cycles (per second). So if it is 100%, that means that every time it checked during a second, there was an active cycle - the cpu was "doing something".

With Unix-based operating systems, "active" is often misleading. The OS scheduler running can be considered "active". The task queue sorting what needs to be done, is "active". So the statement "Load isn't a direct representation of CPU utilization" is false. CPU Utilization is exactly what Load measures.

However, the concept that idle figures are more useful than load is 100% on the money. Or put another way, measuring CPU utilization doesn't mean much, except in extreme cases. (Like if a process goes out of control, and the OS needs to shutdown non-critical services).
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

jshpro2 wrote:oh the misconceptions

http://www.perfdynamics.com/CMG/CMGslides4up.pdf
Whose?

Having read through that, his conclusion seems to match to my description very well:
Load average is an instantaneous view or snapshot of the run-queue with the variance (spikes) damped down.
Of course, that paper is about Linux's load, not Unix, which is what I specified. While he does comment in passing on Solaris (just saying that its old load measurement didn't work "right"), he doesn't examine the unix load measure. But even on linux, after reading it, it still matches up well with my perceptions. What did I miss?
josh
DevNet Master
Posts: 4872
Joined: Wed Feb 11, 2004 3:23 pm
Location: Palm beach, Florida

Post by josh »

Roja wrote: Whose?
'Twas referring to linux users in general, but you did say that that ideally you want it under 1, I'd say numbers as high as 3 are perfectly acceptable as long as your system is not swapping and if you are happy with your load times, (page load times) and typing "top" at the command line doesn't show any threads hogging CPU usage. Although the only times I've ever gotten load above 3 is batch thumb-nailing images and such.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

jshpro2 wrote:
Roja wrote: Whose?
'Twas referring to linux users in general, but you did say that that ideally you want it under 1, I'd say numbers as high as 3 are perfectly acceptable as long as your system is not swapping and if you are happy with your load times, (page load times) and typing "top" at the command line doesn't show any threads hogging CPU usage. Although the only times I've ever gotten load above 3 is batch thumb-nailing images and such.
Yes... I believe a load avg of 5 is when you should *really* consider upgrading your hardware or optimizing your code/queries/config. Just because it's above 1 doesn't mean anything is wrong :) Of course, like you said, it really depends upon whether or not you're happy with the load times etc.

My server is currently runng it bang on 1.0... I'm not itching because it's reached 100% or anything :D
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

jshpro2 wrote:'Twas referring to linux users in general, but you did say that that ideally you want it under 1, I'd say numbers as high as 3 are perfectly acceptable as long as your system is not swapping and if you are happy with your load times, (page load times) and typing "top" at the command line doesn't show any threads hogging CPU usage. Although the only times I've ever gotten load above 3 is batch thumb-nailing images and such.
Ah, okay. Yes, thats a good point.

Personally, I like hardware that is vastly under-utilized. On my webservers, on my router, everything. The only time I like high usage is playing WoW, or doing stress testing for my game. :)

But yes, the linux scheduler on most systems is *fine* at 3 or below. (Thats relatively a new thing. Back in the 2.2 kernel days, a load that high felt HORRIBLE! 2.4 added a ton of changes to the scheduler and more, which helped tremendously with the high-load handling)

So yes, I agree, I was overzealous.

Of course, my dev box:

Code: Select all

--(evil:~/proton)-- #uptime
 21:12:26 up 54 days,  1:08,  1 user,  load average: 0.01, 0.01, 0.02
:)
Post Reply