ow can /proc/loadavg be used ?

來源:互聯網
上載者:User

參見:http://unix.derkeiler.com/Newsgroups/comp.unix.shell/2006-11/msg00577.html

Re: How can /proc/loadavg be used ?
  • From
    : Bruce Barnett <spamhater113+U061115075347@xxxxxxxxxxxx
    >
  • Date
    : Wed, 15 Nov 2006 13:00:11 +0000 (UTC)

Bo Yang <struggle@xxxxxxxxxxxxxxxxxx> writes:

In linux proc filesystem , there is a file
loadavg , it contain three fields seperately
describe the last 1 , 5 , 15 minutes load average .

also avalable in the uptime(1) command for older systems.
The top(1) program shows this as well.

And my question is , how the kernel calculate
these three number ,

The load average is the number of jobs that are ready to run at that time.
Let me give some more detail.

If a process is sleeping because it's waiting for input, it's not
ready to run. So a process waiting for a disk or network input is NOT
ready to run. A process that was using 100% CPU and 0% disk is always
ready to run.

Rarely are jobs 100% CPU or 100% I/O. It's always a mixture.

Three important points

The load average is the number of processes that could run if the
scheduler let them run. A dual core CPU could handle 2 processes using
100% CPU. If that is all that is running, it's fine.

The second is - how quickly do these jobs complete?
If another process starts, and completes quickly - fine.

The third is - how do these numbers look at 1 minute, 5 minutes and 15
minutes, and how do they change.

load average: 10.00, 5.03, 1.00

- this is trouble. The load average is increasing.

load average: 1.00, 5.03, 10.00

- The opposite. The load average was 10.0 fifteen minutes ago,
and the CPU is recovering.

load average: 4.00, 4.03, 4.00

- a steady load

and how big the number is
for a normal running server ?

There is no simple answer. If the computer is able to complete the
jobs in sufficient time, then it is fine. Sufficient is something you
have to define. We can't do that.
Examples:

Web server
Mail server
Financial Database
Simulation server

All of these systems have different requirements for completion of a
job. A load average of 10 may be fine for one, and a disaster for
another.

You can look at other tools as well.
I like top(1) as it shows a lot of information, including percent idle.

p.s. Your English is better than my Chinese.

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.