Linux 操作系統跑Linux慢的分析
發表于:2007-05-26來源:作者:點擊數:
標簽:
挺詳細的。是好東東。 iostat的默認參數是td 默認參數將被完全替代,例 c(terminal, disk, and CPU)。 如,iostat -d將只反 映磁盤的 如果任何其他的選項被指定,這個 統計結果。 語法: 基本語法: iostat interval count option - 讓你指定所 。x 選項給出
挺詳細的。是好東東。
iostat的默認參數是td 默認參數將被完全替代,例
| c(terminal, disk, and CPU)。 如,iostat -d將只反 映磁盤的
| 如果任何其他的選項被指定,這個 統計結果。
|
基本語法: iostat interval count |
option - 讓你指定所 。x 選項給出了完整的統計
| 需信息的設備,像磁盤、cpu或 結果(gives the extended
| 者終端(-d , -c , -t or -tdc )
|
interval - 在兩個samples之間的時間(秒)。 |
extended disk statistics tty cpu |
disk r/s w/s Kr/s Kw
| /s wait actv svc_t %w %b tin
| tout us sy wt id
|
sd0 2.6 3.0 20.7 22.7 0.1 0.2 59
| .2 6 19 0 84 3 85 11 0
|
sd1 4.2 1.0 33.5 8.0 0.0 0.2 47.2 2 23 |
sd2 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0 0 |
sd3 10.2 1.6 51.4 12.8 0.1 0.3 3
| 1.2 3 31
|
The fields have the
| following meanings:
|
Kr/s kilobytes read per second |
Kw/s kilobytes written per second |
wait average number of transacti
| ons waiting for service (Q length)
|
actv average number
| of transactions actively
|
being serviced (removed from the |
%w percent of time t
| here are transactions waitin
| g
|
for service (queue non-empty) |
%b percent of time t
| he disk is busy (transaction
| s
|
Reads/writes per second (r/s , w/s) |
如果磁盤顯示長時間的高reads/writ 同時average service time (svc_t)也遠
| es,并且磁盤的percentage busy (%b)也遠大于5%, 大于30
|
milliseconds,這以下的措施需要被執行: |
1.)調整應用,令其使用磁盤i/o更加 cache
| 有效率,可以通過修改磁盤隊列、使用應用服務器的
|
2.)將文件系統分布到2
| 個或多個磁盤上,并使用volume
| manager/disksuite的條帶化特點
|
3.) 增加系統參數值, values for inode cache ,
| 如inode cache , ufs_ninode。 ufs_ninode , which
| Increase the system parameter
|
is Number of inodes to be held i UFS), not on a per-file system basis
| n memory. Inodes are cached globally (for
|
4.) 將文件系統移到更快的磁盤/控制器,或者用更好的設備來代替 |
vmstat - vmstat反映 ?)和cpu的活動情況
| 了進程的虛擬內存、虛擬內存、
| 磁盤、trap(是不是翻譯成中斷?
|
在多cpu系統中,vmsta 果沒有選項,vmstat顯示一
| t在輸出結果中平均了cpu數量。 行虛擬內存活動的概要
| For per-process statistics .如
|
option - 讓你指定所需的信息類型 etc.
| ,例如 paging -p , cache -c ,.interrupt -i
|
如果沒有指定選項,將會顯示進程、內存、頁、磁盤、中斷和cpu信息 |
The following comman
| d displays a summary of what
| the system
|
is doing every five seconds. |
procs memory page disk faults cpu |
r b w swap free re mf pi p fr de
| sr s0 s1 s2 s3 in sy cs us sy id
|
0 0 0 11456 4120 1 4
| 1 19 1 3 0 2 0 4 0 0 48 112
| 130 4 14 82
|
0 0 1 10132 4280 0 4
| 44 0 0 0 0 0 23 0 0 211 230
| 144 3 35 62
|
0 0 1 10132 4616 0 0 20 0 0 0 0
| 0 19 0 0 150 172 146 3 33 64
|
0 0 1 10132 5292 0 0
| 9 0 0 0 0 0 21 0 0 165 105
| 130 1 21 78
|
The fields of vmstat's display are |
b blocked for resources I/O, pag
| ing etc.
|
swap - amount of swap space curr
| ently available
|
free - size of the free list |
page ( in units per second). |
re page reclaims - s
| ee -S option for how this fi
| eld is modified.
|
mf minor faults - se
| e -S option for how this fie
| ld is modified.
|
de anticipated short-term memory
| shortfall (Kbytes)
|
sr pages scanned by clock algorithm |
disk ( operations per second ) |
There are slots for up to four d
| isks, labeled with a single letter and number.
|
The letter indicates
| the type of disk (s = SCSI,
| i = IPI, etc) . The number is
|
in (non clock) device interrupts |
cpu - breakdown of p an a
| ercentage usage of CPU time.
| On multiprocessors this is
|
verage across all processors. |
Processes in the run queue (procs r) |
1.) 如果processes in 統便慢。
| run queue (procs r)的數量遠
| 大于系統中cpu的數量,將會使系
|
2.) 如果這個數量是cp 幅度降低
| u的4倍的話,說明系統正面臨cp
| u能力短缺,這將使系統運行速度大
|
3.) 如果cpu的idle時 (cpu us)兩輩的話,系統面
| 間經常為0的話,或者系統占用 臨缺少cpu資源
| 時間(cpu sy)是用戶占用時間
|
解決這些情況,涉及到調整應用程序 量。
| ,使其能更有效的使用cpu,同時增加cpu的能力或數
|
內存的瓶頸取決于scan is the pages scanned by
| rate (sr) 。scan rate是每秒 the clock algorithm per
| 時鐘對頁的掃描 (he scan rate
|
second.)如果 scan r
| ate (sr)一直大于200 pages每
| 秒,這時就是內存短缺的現實。
|
1. 調整應用和服務器,使其能更好的使用memory和cache |
dmidecode類似AIX的lsdev,所有的設備基本都可以看到。 |
|
原文轉自:http://www.anti-gravitydesign.com
国产97人人超碰caoprom_尤物国产在线一区手机播放_精品国产一区二区三_色天使久久综合给合久久97
|