wiki:jazz/11-04-04

Version 3 (modified by jazz, 14 years ago) (diff)

--

2011-04-04

VMWare Server : IOWait Performance Tuning

  • 因為經常遇到 IOWait 的問題,所以找一下別人是怎麼解決的。
  • <參考> Gutsy and Vmware-Server – you’re in for some pain
  • 首先修改 /etc/vmware/config
    --- /etc/vmware/config.bak	2011-04-04 22:21:13.000000000 +0800
    +++ /etc/vmware/config	2011-04-06 10:20:42.000000000 +0800
    @@ -22,4 +22,7 @@
     product.name = "VMware Server"
     # Beginning of the block added by the VMware VIX software
     vix.libdir = "/usr/lib/vmware-vix/lib"
    +# 11-04-04: Enhance performance - by Jazz
    +prefvmx.useRecommendedLockedMemSize = "TRUE"
    +prefvmx.minVmMemPct = "100"
     # End of the block added by the VMware VIX software
    
  • 其次修改經常發生 IOWait 的虛擬機器 vmx 設定檔
    • Trac_Pool.vmx

      old new  
      4949debugStub.linuxOffsets = "0x0,0xffffffff,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0,0x0"
      5050
      5151extendedConfigFile = "Trac_Pool.vmxf"
       52
       53sched.mem.pshare.enable = "FALSE"
       54mainMem.useNamedFile = "FALSE"
       55MemTrimRate = "0"
       56MemAllowAutoScaleDown = "FALSE"
  • 另外,不確定是否因為我用單檔 VMDK 所以造成記憶體的 filesytem cache 太高,所以定期用 crontab 清掉一些 cache
    0 * * * * /usr/sbin/ntpdate-debian > /dev/null 2>&1
    0 * * * * echo 1 > /proc/sys/vm/drop_caches
    5 * * * * echo 3 > /proc/sys/vm/drop_caches
    
  • 還可以用 vmware-vdiskmanager 進行虛擬硬碟的檢查跟重組、縮小 - <參考> [http://www.howtoforge.com/how-to-shrink-vmware-virtual-disk-files-vmdk How To Shrink VMware Virtual Disk Files (.vmdk)>
    # 對 myDisk.vmdk 進行重組(defragment)
    vmware-vdiskmanager -d myDisk.vmdk
    # 把 myDisk.vmdk 釋出沒有用到的空白空間(shrink)
    vmware-vdiskmanager -k myDisk.vmdk
    # 把 sourceDisk.vmdk 拷貝成 type 為 0 (single growable virtual disk) 的 destinationDisk.vmdk
    vmware-vdiskmanager -r sourceDisk.vmdk -t 0 destinationDisk.vmdk
    # 把 myDisk.vmdk 容量擴大到 36GB
    vmware-vdiskmanager -x 36GB myDisk.vmdk