wiki:jazz/11-04-04

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

      old new  
      2222product.name = "VMware Server"
      2323# Beginning of the block added by the VMware VIX software
      2424vix.libdir = "/usr/lib/vmware-vix/lib"
       25# 11-04-04: Enhance performance - by Jazz
       26prefvmx.useRecommendedLockedMemSize = "TRUE"
       27prefvmx.minVmMemPct = "100"
      2528# 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 進行虛擬硬碟的檢查跟重組、縮小 - <參考> 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
    
Last modified 14 years ago Last modified on Apr 7, 2011, 4:17:51 PM