隨筆-314  評論-209  文章-0  trackbacks-0

          HP--UX查看內(nèi)存、CPU的使用率

          1、運行/usr/contrib/bin/crashinfo(根據(jù)第二步實際情況) | more,信息中注意類似如下內(nèi)容:
          ==================
          = Memory Globals =
          ==================

          Note: "freemem" was resynced with freemem caches: was 169536, now 168628

          Physical Memory = 2096640 pages (8.00 GB) //物理內(nèi)存總量
          Free Memory = 168628 pages (658.70 MB)//空閑內(nèi)存
          Average Free Memory = 169403 pages (661.73 MB)//平均空閑內(nèi)存
          gpgslim = 7168 pages (28.00 MB)
          lotsfree = 32768 pages (128.00 MB)
          desfree = 7168 pages (28.00 MB)
          minfree = 3328 pages (13.00 MB)
          **************物理內(nèi)存使用率=(物理內(nèi)存總量-空閑內(nèi)存)/物理內(nèi)存總量***************
          ========================
          = Buffer Cache Globals =
          ========================

          dbc_max_pct = 50 %
          dbc_min_pct = 5 %
          dbc current pct = 50.0 %
          bufpages = 1048320 pages (4.00 GB)
          Number of buf headers = 557940

          fixed_size_cache = 0
          dbc_parolemem = 0
          dbc_stealavg = 0
          dbc_ceiling = 1048320 pages (4.00 GB)
          dbc_nbuf = 52416
          dbc_bufpages = 104832 pages (409.50 MB)
          dbc_vhandcredit = 11403
          orignbuf = 0
          origbufpages = 0 pages

          ====================
          = Swap Information =
          ====================

          swapinfo -mt emulation
          ======================

          Mb Mb Mb PCT START/ Mb
          TYPE AVAIL USED FREE USED LIMIT RESERVE PRI NAME
          dev 16384 0 16098 0% 0 - 1 LVM vg00/lv2
          reserve - 2141 -2141
          memory 6460 4928 1532 76%
          total 22844 7069 15489 31% - 0 -
          *****************SWAP內(nèi)存使用率就是total的PCT值:31%*************************
          2、CPU的使用率可以從top參數(shù)得出:
          System: JXCNMD1 Fri Aug 17 10:25:02 2007
          Load averages: 0.35, 0.41, 0.44
          311 processes: 257 sleeping, 53 running, 1 zombie
          Cpu states:
          CPU LOAD USER NICE SYS IDLE BLOCK SWAIT INTR SSYS
          0 0.74 8.8% 3.8% 2.0% 85.5% 0.0% 0.0% 0.0% 0.0%
          1 0.17 4.4% 6.2% 10.2% 79.3% 0.0% 0.0% 0.0% 0.0%
          2 0.12 3.8% 1.0% 1.0% 94.2% 0.0% 0.0% 0.0% 0.0%
          3 0.36 0.0% 70.9% 28.1% 1.0% 0.0% 0.0% 0.0% 0.0%
          --- ---- ----- ----- ----- ----- ----- ----- ----- -----
          avg 0.35 4.2% 20.6% 10.2% 65.1% 0.0% 0.0% 0.0% 0.0%
          *****************系統(tǒng)一共4個CPU,每個CPU的使用率=100%-IDLE值*******************
          3、top命令的一些解釋
          問:
          top中的幾個參數(shù)的意義能幫忙解釋一下嗎?
          主要是對 free的計算方法不太理解,機器的物理內(nèi)存有256M,free中的33M是怎么計算出來
          的呢?

          Memory: 92764K (15880K) real, 65796K (13316K) virtual, 33684K free Page# 1/5

          另外,SAM中有如下有關(guān)信息

          xx x Processor xx Memory xx Operating System xx Network xx Dynamic x x
          xx lqqqqqqqqqqqq/ qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk x
          xx xlqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkx x
          xx xxPhysical Memory: 256.2 MB xx x
          xx xxReal Memory: xx x
          xx xx Active: 21113.5 KB xx x
          xx xx Total: 97083.5 KB xx x
          xx xxVirtual Memory: xx x
          xx xx Active: 16247.3 KB xx x
          xx xx Total: 68390.7 KB xx x
          xx xxFree Memory Pages: 6738 at 4 KB/page xx x
          xx xxSwap Space: xx x
          xx xx Avail: 1024 MB xx x
          xx xx Used: 231 MB xxvx
          xmqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjx

          其中的Virtual Memory和 Swap Space是什么關(guān)系呢?我想計算虛擬內(nèi)存的利用率該如何計算呢?


          答:
          top 只能看到進程所使用的內(nèi)存量,所以你看到的 92764K (15880K) real 就是所有進程所使用的內(nèi)存總和,這個內(nèi)存是指物理內(nèi)存,括號前那個值是Total Real Memory,括號內(nèi)是Active Real Memory, 這兩者的區(qū)別就在于Active Real Memory的值只是分配給那些已經(jīng)在run queue或者正在運行的進程的Real Memory,而Total Real Memory 包括所有的進程。
          對于后一項值 65796K (13316K) virtual 的解釋也是同樣的,不過這個值代表了Virtual Memory(一般為建在Disk上的Swap空間,當(dāng)然你要問了,我的Swap空間可不止這么些啊 by executing ‘swapinfo‘, 沒錯,Swap空間是大于這里的Total Vitual Memory的,但我前面說了,這里的值只是計算的分配給進程的),最后一項33684K free 到確確實實是Free 的Memory,它等于Physical Mem - kernel used - user used - buffer cache。


          下面是對SAM->;Performance Monitor ->; System Property ->; Memory的顯示結(jié)果的解釋

          Physical Memory 256.2 MB 實際物理內(nèi)存大小
          Real Memory
          Active: 21113.5 KB 同 top (當(dāng)然這里舉的例子由于有時間差,所以看上去不大一致)
          Total: 97083.5 KB 同 top
          Virtual Memory:
          Active: 16247.3 KB 同 top
          Total: 68390.7 KB 同 top
          Free Memory Pages: 6738 at 4 KB/page 6738 * 4 就是 top 顯示出來的結(jié)果
          Swap Space:
          Avail: 1024 MB 同Swapinfo中 dev filesystem 總和(一般不會用到Pseudo Memory),為實際Swap Space 的大小。
          Used: 231 MB 同Swapinfo中的Reserve, 為系統(tǒng)在創(chuàng)建進程時為該進程預(yù)留的Swap 空間總和)
          posted on 2010-12-03 20:43 xzc 閱讀(6620) 評論(1)  編輯  收藏 所屬分類: linux/unix

          評論:
          # re: HP--UX查看內(nèi)存、CPU的使用率 2010-12-07 10:55 | 白色彗星
          很詳細,謝謝  回復(fù)  更多評論
            
          主站蜘蛛池模板: 万州区| 耒阳市| 舟山市| 睢宁县| 红桥区| 诸暨市| 格尔木市| 观塘区| 林周县| 博湖县| 拜泉县| 德兴市| 伊吾县| 南充市| 云安县| 宁明县| 湟中县| 南投市| 都匀市| 垦利县| 准格尔旗| 昌乐县| 怀来县| 洱源县| 建湖县| 德清县| 都安| 龙泉市| 平安县| 广元市| 卢湾区| 西吉县| 林口县| 屏山县| 鸡泽县| 淮南市| 漳州市| 宜宾市| 绥江县| 大足县| 竹山县|