Slow VM because I'm broadcasting audio/video over the network

Here you can provide suggestions on how to improve the product, website, etc.
Post Reply
AlexisWilke
Posts: 28
Joined: 11. Mar 2021, 19:25

Slow VM because I'm broadcasting audio/video over the network

Post by AlexisWilke »

I wanted to point out that the network can be a bottleneck as I've searched for this issue several times now and did not find a decent answer to the issue.

So... I have a server with 64 CPUs and 512Gb of RAM. That server usually runs 5 or 6 VMs. On a reboot, it generally goes fast (after everything is loaded, that is... it takes a bit to settle down). Each VM is likely to use well under 10% of one CPU for the most part (usually even under 2%).

Great!

Separate from the VMs, I have a project I'm working on that generates a stream of UDP packets to IP 10.0.0.255. Those are sent to a Jetson (from NVidia, a separate computer). Since it is video, it's constant and quiet heavy (4K video is like 300Kb/s on average). When that application is running, the VMs load on the Host grows to a good 55% each. So if I have 6 VMs running, it uses 300% of the machine to handle those UDP packets.

The fact is that those VMs use a different network (192.168.1.0/24) and therefore my thinking was that the broadcasting to IP 10.0.0.255 would not affect the VMs at all. However, thinking about it, you probably do not know whether the packets may or may not be accepted by the VM. As far as you're concerned, you certainly have to forward all the broadcast packets to those machines and because of that, it uses a ton of CPU time...

I'm good on my end. I can stop that separate software when I use the VMs and vice versa, I can stop 1 or 2 VMs (at least) to ease the pain when I'm working on that software. But if there were a way to prevent a "type" of packet from going through the VM, maybe we could reduce the 55% CPU load to a mere 1% or 2%... Just an idea. I'm not familiar with any of the code in VirtualBox.

Thank you for taking the time of reading this suggestion and especially for providing VirtualBox. It's of great value.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Slow VM because I'm broadcasting audio/video over the network

Post by fth0 »

AlexisWilke wrote:I have a project I'm working on that generates a stream of UDP packets to IP 10.0.0.255.
Using IPv4 broadcast packets for audio/video is generally a bad idea IMHO. If you added Wi-Fi to your network, it would get even worse. I'd suggest to consider using IPv4 multicast packets instead.
AlexisWilke
Posts: 28
Joined: 11. Mar 2021, 19:25

Re: Slow VM because I'm broadcasting audio/video over the network

Post by AlexisWilke »

fth0 wrote:Using IPv4 broadcast packets for audio/video is generally a bad idea IMHO. If you added Wi-Fi to your network, it would get even worse. I'd suggest to consider using IPv4 multicast packets instead.
I had all sorts of problems with multicast, which is why I switched to broadcasting. It may actually have been because at first I was trying to make things work from a VM and the multicast may have worked just fine from the host server instead. VMs also have an issue with clocks. My VMs tend to go bunker in terms of time. If I run them for a long time, it can be off by several seconds, even if I have ntp running.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Slow VM because I'm broadcasting audio/video over the network

Post by fth0 »

AlexisWilke wrote:VMs also have an issue with clocks. My VMs tend to go bunker in terms of time. If I run them for a long time, it can be off by several seconds, even if I have ntp running.
On a Windows host, that sometimes happens when the Windows hypervisor (Hyper-V) is active. Do you see a green turtle in the status line of the VM's window?
AlexisWilke
Posts: 28
Joined: 11. Mar 2021, 19:25

Re: Slow VM because I'm broadcasting audio/video over the network

Post by AlexisWilke »

fth0 wrote:On a Windows host, that sometimes happens when the Windows hypervisor (Hyper-V) is active. Do you see a green turtle in the status line of the VM's window?
You mean in this status bar?
http://alexis.m2osw.com/images/virtualb ... -icons.png
I don't see a turtle...

The "double screen" (4th icon from the left) has a little green "light" which flickers when the network is going.

I checked to see whether it seems to be flashing a lot faster when I have the issue... it's not exactly faster (a bit) but the green light goes to red half the time. I suppose that's an indication that a lot of traffic goes through.
fth0
Volunteer
Posts: 5668
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Slow VM because I'm broadcasting audio/video over the network

Post by fth0 »

Yes, in that status bar. Instead of the blue IC icon with the white "V" on its back, you'd see a green turtle. So you don't have the common problem.

For long-running VMs, I've also seen time losses in the VMs, but never bothered to analyze them in detail.

Regarding the network icon, AFAIK the green dot indicates reading (receiving), and the red dot indicates writing (transmitting), the latter having precedence over the former.
Post Reply