系統管理
1752800 會員
5630 線上
108789 解決方案
發表新文章

請問這個loading average是怎樣算出來的

 
watermelonyu
教授

請問這個loading average是怎樣算出來的

#w出現的畫面loading約在11

14:11:22 up 1:29, 6 users, load average: 11.06, 11.09, 11.01

#top出現的畫面loading約在11

load average: 11.08

但是我的cpu idle 都在90%以上

#vmstat 3

procs memory swap io system cpu

r b swpd free buff cache si so bi bo in cs us sy wa id

0 0 0 486460 24860 565216 0 0 21 217 108 175 1 1 2 97

1 0 0 486340 24868 565216 0 0 0 0 116 159 2 3 0 96

2 0 0 486340 24876 565216 0 0 0 15 119 154 0 1 0 98

0 0 0 486340 24876 565216 0 0 0 0 121 155 0 1 0 99

請問這個loading是怎樣算出來的,loading這麼高是誰用掉的
7則回覆 7
watermelonyu
教授

請問這個loading average是怎樣算出來的

load average is the sum of the run queue length.



in your system, maybe you have many process

STATE is sleep, wait for i/o(include disk, network ...),..... depands on your application behavior
watermelonyu
教授

請問這個loading average是怎樣算出來的

我的cpu idle很高,表示根本沒有process在用cpu

也應該沒有wait/io?

這樣應該沒有job會que吧

process is sleep也會造成我的loading 變重嗎
watermelonyu
教授

請問這個loading average是怎樣算出來的

這個問題很有意思, 可惜並沒有討論出結論,有幾點想法, 如有錯誤, 請指正



1. w & top 所顯示的 loading averages 都是the number of jobs in the run queue, 所以數字應該是一致的



不論是 HP-UX, Linux , Tru64 都一樣
watermelonyu
教授

請問這個loading average是怎樣算出來的

2. HP-UX 的 vmstat 的 process (r) 也是 In run queue, 只是數字應該也會是跟 w & top 一致,



可以同時開啟 top & vmstat 觀察

watermelonyu
教授

請問這個loading average是怎樣算出來的

3. Tru64 的 vmstat 的 process (r) 是 Number of threads that are running or are runnable



所以跟 w & top 的 loading averages 並不相同, 我觀察到的結果是, vmstat 的 process (r) 大約是 w & top 的 loading averages 2 ~ 3 倍.



因為 loading averages 是 process, 而 vmstat 的 process (r) 是 threads, threads 是 process 的 2 ~ 3 倍, 應該是合理
watermelonyu
教授

請問這個loading average是怎樣算出來的

4. Linux vmstat 的 process (r) 也是 The number of processes waiting for run time,



所以照理說, 數字應該也會是跟 w & top 一致,

我觀察到的也是這樣



watermelonyu
教授

請問這個loading average是怎樣算出來的

底下是我的整理

HPUX

r In run queue

b Blocked for resources (I/O, paging, etc.)

w Runnable or short sleeper (< 20 secs) but swapped



Tru64

r Number of threads that are running or are runnable.

w Number of threads waiting interruptibly.

u Number of threads waiting uninterruptibly.



AIX

r Number of kernel threads placed in run queue.

b Number of kernel threads placed in wait queue(awaiting resource, awaiting input/output).



SUN

r in run queue

b blocked for resources I/O, paging, and so forth

w swapped



Linux

r: The number of processes waiting for run time.

b: The number of processes in uninterruptable sleep.

w: The number of processes swapped out but otherwise runnable. This

field is calculated, but Linux never desperation swaps.