Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to improve network performance between VMs #10

Open
Milon-yang opened this issue Dec 8, 2021 · 13 comments
Open

How to improve network performance between VMs #10

Milon-yang opened this issue Dec 8, 2021 · 13 comments

Comments

@Milon-yang
Copy link

Hi,

I use iperf to test the network performance, the result shows the sending and receiving performance of network data between VMs is 35MB/sec. What maximum data throughput does L4RE support?Can we further improve its performance, and how to?

Thanks!

@icedieler
Copy link
Contributor

icedieler commented Dec 8, 2021

Hi,
I assume you used our virtual virtio peer-to-peer link to connect the VMs? The achievable performance then depends on the VM configuration (e.g. vCPU to CPU assignment), the type of traffic (TCP or UDP) and also the memory bandwith of the platform you are using.
Our virtio peer-to-peer link only (mem)copies network packets between the VMs and does no checksumming or whatsoever. That means the memory bandwith is the upper limit here. In the VMs you have to account for the processing of the network packets.
From your question I defer that you were expecting a better performance. What was you expectation?
Cheers,
Matthias.

@alacko
Copy link

alacko commented Dec 9, 2021

Hi, are you doing network between different cores or VMs running on the same core?

@Milon-yang
Copy link
Author

Hi, are you doing network between different cores or VMs running on the same core?

I did it on the same core

@Milon-yang
Copy link
Author

Hi, I assume you used our virtual virtio peer-to-peer link to connect the VMs? The achievable performance then depends on the VM configuration (e.g. vCPU to CPU assignment), the type of traffic (TCP or UDP) and also the memory bandwith of the platform you are using. Our virtio peer-to-peer link only (mem)copies network packets between the VMs and does no checksumming or whatsoever. That means the memory bandwith is the upper limit here. In the VMs you have to account for the processing of the network packets. From your question I defer that you were expecting a better performance. What was you expectation? Cheers, Matthias.

Yes, I need to improve the network bandwidth between the VMs.
Do you have any suggestion or guidance note ?

@Milon-yang Milon-yang reopened this Dec 9, 2021
@alacko
Copy link

alacko commented Dec 9, 2021

Hi, are you doing network between different cores or VMs running on the same core?

I did it on the same core

Ok, could you put the VMs on different cores and possibly also the switch to another one and compare?

@Milon-yang
Copy link
Author

Hi,

I try to create 2 VMs, one occupies cpu0, while another VM occupies cpu3. then use l4vio_net_p2p for virtual network between VMs.
The network performance is still as same as in same cpu.
1639114018(1)

@alacko
Copy link

alacko commented Dec 12, 2021

Please try to increase the queue size with the virtio-net component using the -s switch, like -s 4096. Increasing the MTU size in Linux might also be helpful.

@Milon-yang
Copy link
Author

Thanks for your suggestion.
I tried to increasing the MTU size in Linux, the network performance could be improved. for example, I changed the value from 1500 to 9000, the network bandwidth improved to 110M/sec.

But when I changed virtqueue size from 256 (defalut value) to 4096, the network bandwidth only improved to 40M/sec.

1639389030(1)

By the way, I just changed the var "vq_max_num" in l4/pkg/virtio-net/server/p2p-link/net.cc, I don't know if I changed it correctly.

@alacko
Copy link

alacko commented Dec 13, 2021

If it works it's change correctly I guess. The value can probably be even higher. And please combine with the MTU increase.
What you can also try to put the network component on a separate core on its own (i.e. use 3 cores for this setup).

@Milon-yang
Copy link
Author

I increased the mtu value to 65535 (the biggest value), the network bandwidth improved to 310M/sec.
But when increase virtqueue size combined with mtu value, the performance can not be further improved, In other words, increasing virtqueue size didn't work very well.

In fact, I want to improve the bandwidth to 1GB/sec at least. Is there any other ways?

Thanks.

@icedieler
Copy link
Contributor

I increased the mtu value to 65535 (the biggest value), the network bandwidth improved to 310M/sec.

Is it MB/s or Mbits/s?

In fact, I want to improve the bandwidth to 1GB/sec at least. Is there any other ways?

Do you happen to know the memory bandwidth of your platform? 10G sounds very ambitious to me.

@Milon-yang
Copy link
Author

Milon-yang commented Dec 15, 2021

It is MBytes/sec
I experimented on PCU2.0, the memory bandwidth is 8G.

@jiangfenghua123
Copy link

the memory bandwidth of pcu is 51.2GB/s

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants