天天看點

解決 PVE 虛拟機 CPU 性能差的方案

發現性能問題

最近裝了 Proxmox VE,建了虛拟機後跑了一下 AES-NI 的測試:

$ openssl speed -elapsed -evp aes-128-gcm
           

發現虛拟機和主控端的性能相差幾十倍,因為需要虛拟機有強 AES 性能,是以找了一下解決方案,發現是以下問題(摘自 Reddit):

Check

/proc/cpuinfo

on the host, and compare it against

/proc/cpuinfo

on the VMs. You’ll find the VMs missing essentially all the processor features introduced this century, even though they’re supported by your host CPU.

随後檢查了一下,發現确實是這樣。原來問題出在了建立虛拟機的時候 CPU 類型選擇錯了。

解決方法

非常簡單,在 PVE 管理界面中選擇修改虛拟機配置:

Hardware > Processors > Edit > 設定為 host。
           

重新跑分,分數已相差無幾,問題解決。

參考

  1. AES-NI SSL Performance
  2. Poor performance on an R710 with Proxmox.2 x L5640 and 64GB of RAM

繼續閱讀