ひょんなことで、Proxmoxを立てた。そこで前から気になっていることがあった。
Virtio NICのMultiple Queue設定。
QNAP NASのVirtualization Stationは、NICのQueueが1しか指定できないので、vCPUを増やしても転送に使われるvCPUが1になる。別に1Gbpsで適当な用なら、それで構わないのだが、複数の通信を捌くのであれば、vCPU数くらいの数にしておいたほうが効率的なのではないか?さらに今は、2.5Gbpsやら10Gbpsなので、効果は高いと思う。
以下、デフォルトで作成したVM

Queueの指定がないので1
root@debian12-test:~# ethtool -l enp6s18
Channel parameters for enp6s18:
Pre-set maximums:
RX: n/a
TX: n/a
Other: n/a
Combined: 1
Current hardware settings:
RX: n/a
TX: n/a
Other: n/a
Combined: 1
root@debian12-test:~# ls /sys/class/net/enp6s18/queues/
rx-0 tx-0
root@debian12-test:~# grep -i virtio /proc/interrupts
29: 0 0 0 0 PCI-MSI 4734976-edge virtio2-config
30: 0 0 0 0 PCI-MSI 4734977-edge virtio2-control
31: 0 0 0 0 PCI-MSI 4734978-edge virtio2-event
32: 643 0 0 0 PCI-MSI 4734979-edge virtio2-request
33: 0 1128 0 0 PCI-MSI 4734980-edge virtio2-request
34: 0 0 356 0 PCI-MSI 4734981-edge virtio2-request
35: 0 0 0 944 PCI-MSI 4734982-edge virtio2-request
36: 0 0 0 0 PCI-MSI 3440640-edge virtio1-config
37: 0 0 3505 0 PCI-MSI 3440641-edge virtio1-input.0
38: 0 0 0 98 PCI-MSI 3440642-edge virtio1-output.0
39: 0 0 0 0 PCI-MSI 3194880-edge virtio0-config
40: 0 820 0 0 PCI-MSI 3194881-edge virtio0-virtqueues
Queueの指定を4にしてみる。

Queueの指定を4にした。

Queueが4に増えている
root@debian12-test:~# ethtool -l enp6s18
Channel parameters for enp6s18:
Pre-set maximums:
RX: n/a
TX: n/a
Other: n/a
Combined: 4
Current hardware settings:
RX: n/a
TX: n/a
Other: n/a
Combined: 4
root@debian12-test:~# ls /sys/class/net/enp6s18/queues/
rx-0 rx-1 rx-2 rx-3 tx-0 tx-1 tx-2 tx-3
root@debian12-test:~# grep -i virtio /proc/interrupts
28: 0 0 0 0 PCI-MSI 3440640-edge virtio1-config
29: 287 0 0 0 PCI-MSI 3440641-edge virtio1-input.0
30: 24 1 0 0 PCI-MSI 3440642-edge virtio1-output.0
31: 0 32 0 1 PCI-MSI 3440643-edge virtio1-input.1
32: 1 10 0 0 PCI-MSI 3440644-edge virtio1-output.1
33: 0 1 228 0 PCI-MSI 3440645-edge virtio1-input.2
34: 0 0 12 0 PCI-MSI 3440646-edge virtio1-output.2
35: 0 0 0 137 PCI-MSI 3440647-edge virtio1-input.3
36: 1 0 0 43 PCI-MSI 3440648-edge virtio1-output.3
38: 0 0 0 0 PCI-MSI 4734976-edge virtio2-config
39: 0 0 0 0 PCI-MSI 4734977-edge virtio2-control
40: 0 0 0 0 PCI-MSI 4734978-edge virtio2-event
41: 582 0 0 0 PCI-MSI 4734979-edge virtio2-request
42: 0 709 0 0 PCI-MSI 4734980-edge virtio2-request
43: 0 0 482 0 PCI-MSI 4734981-edge virtio2-request
44: 0 0 0 1071 PCI-MSI 4734982-edge virtio2-request
45: 0 0 0 0 PCI-MSI 3194880-edge virtio0-config
46: 0 0 0 190 PCI-MSI 3194881-edge virtio0-virtqueues
Proxmox公式の基本方針は、VirtIO Multiqueue の queue 数は VM の vCPU 数に合わせることを推奨しているが、デフォルトは1にしかならない。
実際、この値をvCPUに合わせたら必ず良くなるわけでもない。1Gbpsだったら転送速度が上がるというものでもない。vCPUへの負荷がばらけるのがメイン。ネットワーク帯域が高い場合は、転送速度も上がるかもしれない。もっぱら、vCPUの数にこだわるアプリだったら設定を確認した方がいいと思う。
いかんせん、デフォルトが1というのは初めて知った。もしかして、知らなかったのは俺だけか?それくらいProxmoxは動かしていない。。。
ちなみに、VMwareや激推しのIncusは、自動でvCPU数に合わせてちゃんと設定をしてくれる。ちなみにvCPUの数をかなり大きな数にしても追従するわけではない。仮想マシンのvCPU数を増やしても性能がリニアに上がらないのをやんわり教えてくれているのかもしれない。
というわけで、Proxmoxはやはり要らないかも。