系统规格如下:
- 62.8GB RAM
- 1TB 硬盘空间 - Samsung 960 Pro M.2
- CPU 是 AMD Threadripper 1950x - 16Core
- 运行 Ubuntu 17.10
- Virtualbox 5.1.34_Ubuntur121010
所以我从小处着手,我想从同时运行 5 个虚拟机开始,所以我将它们全部设置为拥有 2 个处理器,并使用 2048MB 的 RAM。我看到的是我的无头虚拟机消耗的内存是预期内存 (RES) 的 7 倍多。我附上了 5 个正在运行的无头进程的屏幕截图,在占用了大部分 RAM 后,它开始使用交换,正如您所见,我们非常接近消耗 RAM 和交换。
在使用 vmware 工作站的较小系统上,我似乎停留在分配的内存空间内,是否有我遗漏的设置?这看起来不像是缓存问题,请参阅所附图片。
由于运行 5 台虚拟机会迫使我重新启动系统,所以我最终将其设置为 3 台虚拟机,这是“ps aux | grep -i headless”:
布谷鸟 35092 29.8 18.7 15761556 12357644 ? Sl 15:36 0:14 /usr/lib/virtualbox/VBoxHeadless --comment win7x64-vm-101 --startvm 684e8e07-80f5-4b54-b44a-176658a2443e --vrde config 布谷鸟 35210 33.3 18.7 15757460 12357408 ? Sl 15:36 0:11 /usr/lib/virtualbox/VBoxHeadless --注释 win7x64-vm-102 --startvm 5e93a116-7489-4b10-988c-797dd290dcb0 --vrde 配置 cuckoo 35355 66.8 18.7 15749140 12357636 ? Sl 15:37 0:10 /usr/lib/virtualbox/VBoxHeadless --注释 win7x64-vm-103 --startvm faf7fc9b-2448-4ea7-aa65-16eab611dce5 --vrde 配置
showvminfo 是这样的:
Name: win7x64-vm-101
Groups: /
Guest OS: Windows 7 (64-bit)
UUID: 684e8e07-80f5-4b54-b44a-176658a2443e
Config file: /home/cuckoo/.vmcloak/vms/win7x64-vm-101/win7x64-vm-101.vbox
Snapshot folder: /home/cuckoo/.vmcloak/vms/win7x64-vm-101/Snapshots
Log folder: /home/cuckoo/.vmcloak/vms/win7x64-vm-101/Logs
Hardware UUID: 684e8e07-80f5-4b54-b44a-176658a2443e
Memory size: 2048MB
Page Fusion: off
VRAM size: 16MB
CPU exec cap: 100%
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 2
PAE: on
Long Mode: on
Triple Fault Reset: off
APIC: on
X2APIC: off
CPUID Portability Level: 0
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: on
BIOS APIC mode: APIC
Time offset: 0ms
RTC: local time
Hardw. virt.ext: on
Nested Paging: on
Large Pages: off
VT-x VPID: on
VT-x unr. exec.: on
Paravirt. Provider: Default
Effective Paravirt. Provider: HyperV
State: running (since 2018-07-16T20:11:32.340000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Tracing Enabled: off
Allow Tracing to Access VM: off
Tracing Configuration:
Autostart Enabled: off
Autostart Delay: 0
Default Frontend:
Storage Controller Name (0): IDE
Storage Controller Type (0): PIIX4
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 2
Storage Controller Port Count (0): 2
...