Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

uptime reports load averages over the last 1, 5, and 15 minutes.

How can I view the load average over the last 10 seconds?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

That's impossible because the kernel doesn't compute it. (Well, you could patch the kernel of course...).

Remember that the load average is not a "regular average" of a set of numbers like you learned to compute in high school. Keeping around samples for 15 minutes and computing 3 averages over that array several times a second would require way too much memory & CPU power.

The "load average" (on linux) is an exponentially damped/weighted moving average, meaning it indicates a trend over time. See my answer to this related question for a couple of links to sites with more info.

If you know a bit of programming, it's actually easy to understand from the kernel sources too--that's how somebody teached me this. See page 2 of the link to the Linux Journal article for that.

share|improve this answer

What JanC explained is correct. However, you can compute this by measuring the run-queue length (number of active threads waiting for the CPU) of your system. Unfortunately there is no utility/tool available for Linux. If you want to play around this, you can do this on OpenSolris even with microseconds resolution using DTrace scripts. It is pretty much easy. You can easily find such a script on the WEB.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.