OpenBSD Journal

Load averages...

Contributed by jose on from the performance dept.

Aasmund Godal asks: "I have a computer today that runs at about .80 in load average. It's a web server with proxy and database driven dynamic pages. I want to know how much more it can handle, and I wondered if the load averages could give me a clue. I realize that they mean the average number of processes in the cue, but I am unsure of the effect of this. Does it practically mean it's running at 80%? memory is not a problem, I have plenty extra...

thanks! and regards." Actually measuring the performance of a machine (using top, ps, vmstat, and the like) is a complex, but not terribly difficult, process. Anyone have any good docs on how to do this in BSD?

(Comments are closed)


Comments
  1. By Fazal Majid () openbsdjournal@majid.fm on http://www.majid.info/

    Load average is a queueing theory metric. If you assume your machine's workload is a Poisson process (seldom the case, but it's the only example that is analytically easily tractable), the load average of a machine running at X% of its capacity should be (X/100)/(1-X/100), or alternatively X = 100 x 1/(1 + load avg) and thus a load average of .8 suggests your machine is running at 100x1/(1+0.8) = 55% capacity.

    This is a very rough guide, of course. It is seldom a good idea to run computers or networks at more than 70% or so capacity.

    Comments
    1. By Anonymous () root@localhost on mailto:root@localhost

      The fancy rhetoric besides, the load average only tells you how many processes are in the run queues over a period of time. You could propably have a load average of 10.0, and still only use 50% of your computers "capacity".

      Comments
      1. By krh () on

        No, you're missing the point. Load average is meant to measure one particular kind of capacity in one particular kind of way. If the load average is 1.00, then, according to this metric, your computer is running at capacity because it can just barely handle all of the running processes it has. And if the load average is at 0.8, then according to this metric you're at 66.7% capacity, because you have room to schedule half again as many running processes. And so on.

        Load average doesn't measure the maximum amount of "work" your computer can do, for some vague yet predictive definition of "work". And the word "capacity" as used in the definition of load average is a technical one, referring not to the maximum amount of room you have to work with but to how many processes in the queue you are able to schedule without delaying any of them.

        From the point of view of queueing theory the load average is a natural metric. For system optimization I'm not so sure that it's useful.

        Comments
        1. By krh () on

          > And if the load average is at 0.8, then according to this metric you're at 66.7% capacity,

          Whoops, I meant "if the load average is 0.5".

    2. By Rob Funk () on

      By your 1/(1+lavg) formula, a load average of zero means you're at 100% capacity, while a load average of one means you're at 50% capacity. I might believe the latter number, but I can't believe that an increasing load average means a decreasing capacity.

      I think you want X = 100 * loadavg/(1+loadavg); at least that's what I derive from your first formula.

  2. By anonymous () on

    Watch your memory, probably worse than maxing out the cpu, is running out of memory and swapping to the hard drive.

    In reality I have seen that happen more on server boxes, like apache+php+mysql, probably because normally openbsd does so well with 64meg or 128meg until a website really gets a lot of simultaneuous users needed sql info, then you have to run over to the farm and find out that the motherboard won't use a 256 sdram stick even though it should have, the website just got
    mentioned as a must resource in several local newspaper, you look bad even though its only down 2-4 hours, and have to run back for multiple 128 sdram sticks, and then later decide it would have been cheaper to buy a $200 box from walmart than keep that 3/5 year old motherboard going :)

  3. By John Benninghoff () jbenninghoff@mn.rr.com on mailto:jbenninghoff@mn.rr.com

    I think you mean that X = 100*(load/1+load). For a load average of 0.8, this yields 100*(0.8/1.8) = 44.4%.

    70% capacity would be a load average of 0.7/0.3 = 2.33.

    Comments
    1. By Aasmund () on

      This seems an odd way of calculating, as a computer would never get to 100%. x/1+x is always less than 1.

      Comments
      1. By Rob Funk () on

        Sure, that capacity formula never gives 100% capacity, but if it could that would imply that there's some maximum load average beyond which the computer can't go. Since the load average comes from the number of processes waiting to run, and you can always add another process to that list (until you fill the process table, but that's unrelated to machine capacity, just OS capacity), a maximum load average is impossible.

        So when determining capacity from load average, the only way of interpreting the capacity that makes sense is to define some maximum percentage beyond which you should increase your CPU speed.

        Of course, load average alone is an unreliable method of measuring CPU capacity.

  4. By djm () on

    particularly "systat vm"

  5. By henkjan () avatar@tweakers.net on http://bsdconeurope.org/papers/horn.pdf

    Maybe this paper from BSDCon Europe 2002 wil help?

    Monitoring the world with NetBSD: http://bsdconeurope.org/papers/horn.pdf

  6. By djm () on

    "man systat"

    systat will tell you nearly everything you need to know in real time, including real CPU utilisation (which loadavg isn't), VM usage, IO throughput, even network statistics.

    "systat io" is a reasonably non-technical entry point. "systat vm" is very useful indeed.

    Comments
    1. By The Rear Admiral () on

      No shit... I just gave your 'systat vm' suggestion a try and it's pretty cool. I gotta remember to keep that one on tap for later...

Credits

Copyright © - Daniel Hartmeier. All rights reserved. Articles and comments are copyright their respective authors, submission implies license to publish on this web site. Contents of the archive prior to as well as images and HTML templates were copied from the fabulous original deadly.org with Jose's and Jim's kind permission. This journal runs as CGI with httpd(8) on OpenBSD, the source code is BSD licensed. undeadly \Un*dead"ly\, a. Not subject to death; immortal. [Obs.]