系統管理
1752278 會員
5025 線上
108786 解決方案
發表新文章

swapinfo的输出问题

 
watermelonyu
教授

swapinfo的输出问题

大家好,我的机器物理内存为384M,swap分区为900m

# swapinfo -ta

Kb Kb Kb PCT START/ Kb

TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME

dev 921600 0 921600 0% 0 - 1 /dev/vg00/lvol2

reserve - 109388 -109388

memory 281728 47160 234568 17%

total 1203328 156548 1046780 13% - 0 -

请问上面的参数是什么意思呢?我看得不是很清楚,dev应该是指我的swap分区的大小吧,但是怎么一点都没有用?

memory应该是指我的物理内存大小吧,但怎么和机器上的不配置?

请大家在有时间的时候详细的给我讲解一下可以吗?谢谢!
4則回覆 4
watermelonyu
教授

swapinfo的输出问题

請先看看#man swapinfo



至於dev部分沒用到, 表示說系統的

physicial memory還是充足的, 還沒有paging的現象.



--cut from man page -------------------------

If all file system paging areas are completely

allocated and the request is still not

satisfied, the system will try to use memory

paging as described on the memory line above.

(Memory paging is controlled by the tunable

parameter swapmem_on, which defaults to

1 (on). If this parameter is turned off, the

memory line will not appear.)

--end of cut --------------------------------



以上大致內容是說, 因HPUX的memory管理機制, 在程式啟動

時, 也許因為physical memory不夠, 無法將process帶

起, 系統進而啟用swapon機制, 增加memory size, 順而將程式帶起. memory欄位的值並非真正主機上所裝的memory size
watermelonyu
教授

swapinfo的输出问题

可以從幾個方面來看



1. dev 的部份是指 swap 空間, 看你系統如何使用 swap 囉

2. reserve 的部份是由 OS 所保留下來部份

3. memory 並不是你所說的實際記憶體大小, 而是使用了pseudo-swap 才會出現, 你可以查看一下 kernel 參數 swapmem_on 是否設為 1



至於什麼是 pseudo-swap, 看看下面的解釋



http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=zh_TW&docId=200000073610126
watermelonyu
教授

swapinfo的输出问题

watermelonyu
教授

swapinfo的输出问题

根據個人經驗

Dev指Swap的空間,未使用表示physical Memory夠用,但要注意reserve的部份,以Virtual Memory來說,只要被宣告reserve,其他Process應該就無法再allocate



而reserve個人感覺應該比較跟AP有關,因曾觀察過某個case,開機時為250MB左右,啟動Oracle約到2GB,再啟動ERP約到2.5GB,但接著開始運作有時會大量增加到14GB,有去用sar觀察過process使用VM的狀態,幾乎都是由oracle所fork出來的sub-process所佔用了,所以應該跟OS比較無關.



看swapinfo資訊簡單幾個心得

1.使用到dev則效能會比用physical mem差

2.注意reserve與used比例情況,太大要追查AP或DB

3.不能讓Total的Used超過100%,否則系統鐵定hang住

4.Memory的使用建議參考glance感覺比較準確