我想使用我的 VMware 将临时文件添加到 /dev/shm,但我发现这个方法可以提高虚拟机的性能:
mount -t tmpfs -o size=5G,nr_inodes=5k,mode=700 tmpfs /disk2/tmpfs
但我不知道它在做什么(它是自适应 ramdisk)以及为什么它可以帮助提高性能?我是否已将其添加到我的 fstab 中?这是我的 vmware 设置:
#temp directory
tmpDirectory="/disk2/tmpfs"
# bugfix
host.cpukHz = "2200000"
host.noTSC = "TRUE"
ptsc.noTSC = "TRUE"
# I/O fix
prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"
# temp file fix
mainMem.useNamedFile = "FALSE"
MemTrimRate=0
MemAllowAutoScaleDown = "FALSE"
# Cpu fix
mem.ShareScanTotal=0
mem.ShareScanVM=0
mem.ShareScanThreshold=2024
sched.mem.maxmemctl=0
sched.mem.pshare.enable = "FALSE"
# Disable 3d
mks.enable3d = "true"
也许这是正确的命令:tmpfs /dev/shm tmpfs defaults,size=5G,nr_inodes=5k,mode=700 0 0
?
答案1
此设置大大提高了我的客户机的性能。我的主机是带有 BFS 的 64 位 Linux 机器,计时器为 1500hz。我的主机有 6GB 物理内存,我创建了一个 5GB 的 ramdisk。
# create a ramdisk
tmpfs /dev/shm tmpfs defaults,size=5G,nr_inodes=5k,mode=700 0 0
#temp directory
tmpDirectory="/dev/shm"
# bugfix
host.cpukHz = "XXXX"
host.noTSC = "TRUE"
ptsc.noTSC = "TRUE"
sched.cpu.max = "xxxx"
# I/O fix
prefvmx.useRecommendedLockedMemSize = "TRUE"
prefvmx.minVmMemPct = "100"
# prevent swapping
mainMem.partialLazySave = "FALSE"
mainMem.partialLazyRestore = "FALSE"
# temp file fix
mainMem.useNamedFile = "FALSE"
MemTrimRate=0
MemAllowAutoScaleDown = "FALSE"
# Cpu fix
mem.ShareScanTotal=0
mem.ShareScanVM=0
mem.ShareScanThreshold=4096
sched.mem.maxmemctl=0
sched.mem.pshare.enable = "FALSE"
# Disable 3d
mks.enable3d = "false"
#
diskLib.maxUnsyncedWrites = "0"
diskLib.dataCachePageSize = "4096"
diskLib.dataCacheMinReadAheadSize = "0"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
disk.locking = "FALSE"
#
logging = "FALSE"
snapshot.disabled = "TRUE"
#
priority.grabbed = "high"
priority.ungrabbed = "normal"
# Enabling VT-x if Unlocked
hv.enableIfUnlocked = "TRUE"
# Linux
mainmem.backing= "swap"
#
disable_acceleration = "FALSE"
hard-disk.enableIBR = "FALSE"
还建议编译具有最大 1khz 定时器频率的内核。
- https://serverfault.com/questions/275637/degraded-disk-io-performance-on-esx-4-1-over-time
- Windows 7 通过磁盘缓存损害了 VMWare 的性能?
- https://www.techenclave.com/community/threads/post-you-vmware-workstation-optimization-parameters-in-linux.117618/
- https://virtualizationreview.com/blogs/virtual-insider/2011/06/top-10-vmware-view-performance-tips.aspx
- https://miketabor.com/my-vmware-view-windows7-optimization-guide/