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

support socket_vmnet for vz driver #1279

Merged
merged 1 commit into from
Jan 7, 2023
Merged

Conversation

balajiv113
Copy link
Member

The support for socket_vmnet is provided as mentioned over here
lima-vm/socket_vmnet#13 (comment)

Note:
This is done so that we can easily support QEMU based network stack in vz as well. This might have a reduced performance due to pipe of dgram <-> unix socket connection

@balajiv113
Copy link
Member Author

Performance Results (Shared network)

One VZ Instance
---------------
Host (iperf3 -s) - VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.73 GBytes  1.49 Gbits/sec    0             sender
[  5]   0.00-9.98   sec  1.73 GBytes  1.49 Gbits/sec                  receiver

VM (iperf3 -s) - Host (iperf3 -c)

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   601 MBytes   504 Mbits/sec                  sender
[  5]   0.00-10.01  sec   600 MBytes   503 Mbits/sec                  receiver

One QEMU Instances
-----------------------
Host (iperf3 -s) - VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.63 GBytes  1.40 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  1.63 GBytes  1.40 Gbits/sec                  receiver

VM (iperf3 -s) - Host (iperf3 -c)

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   561 MBytes   470 Mbits/sec                  sender
[  5]   0.00-10.08  sec   559 MBytes   466 Mbits/sec                  receiver

One VZ & QEMU Instances
-----------------------
Host (iperf3 -s) - VZ VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.12 GBytes   965 Mbits/sec    0             sender
[  5]   0.00-10.03  sec  1.12 GBytes   962 Mbits/sec                  receiver

Host (iperf3 -s) - QEMU VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.04 GBytes   891 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.04 GBytes   889 Mbits/sec                  receiver

VZ VM (iperf3 -s) - Host (iperf3 -c)

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   608 MBytes   510 Mbits/sec                  sender
[  5]   0.00-10.00  sec   607 MBytes   509 Mbits/sec                  receiver

QEMU VM (iperf3 -s) - Host (iperf3 -c)

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec   638 MBytes   535 Mbits/sec                  sender
[  5]   0.00-10.00  sec   637 MBytes   534 Mbits/sec                  receiver

QEMU VM (iperf3 -s) - VZ VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.28 GBytes  1.10 Gbits/sec    0             sender
[  5]   0.00-10.02  sec  1.28 GBytes  1.09 Gbits/sec                  receiver

VZ VM (iperf3 -s) - QEMU VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.09 GBytes   933 Mbits/sec    0             sender
[  5]   0.00-10.00  sec  1.08 GBytes   931 Mbits/sec                  receiver

@balajiv113
Copy link
Member Author

Performance Results (Bridge network)

Host (iperf3 -s) - VZ VM (iperf3 -c)

[ ID] Interval           Transfer     Bitrate         Retr
[  5]   0.00-10.00  sec  1.97 GBytes  1.70 Gbits/sec    0             sender
[  5]   0.00-10.00  sec  1.97 GBytes  1.69 Gbits/sec                  receiver

VZ VM (iperf3 -s) - Host (iperf3 -c)

[ ID] Interval           Transfer     Bitrate
[  5]   0.00-10.00  sec  2.20 GBytes  1.89 Gbits/sec                  sender
[  5]   0.00-10.00  sec  2.20 GBytes  1.89 Gbits/sec                  receiver

pkg/vz/pipe.go Outdated

// PipeToQemuConn support connecting to QEMU supported network stack via unix socket
// Returns os.File, connected dgram connection to be used for vz
func PipeToQemuConn(unixSock string) (*os.File, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem a "pipe".

Maybe we can just call it DialQemu

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@AkihiroSuda
Copy link
Member

Thanks, the overhead doesn't seem bad 👍

Could you also update the docs?
https://github.com/lima-vm/lima/blob/master/docs/network.md#vz
https://github.com/lima-vm/lima/blob/master/examples/vmnet.yaml

@balajiv113
Copy link
Member Author

Updated the docs.

overhead doesn't seem bad

I believe technically we are doing the same thing like QEMU.
Maybe there will be a performance difference if we compare raw vz <-> piped vz. raw vz might be even faster than QEMU.

AkihiroSuda
AkihiroSuda previously approved these changes Jan 6, 2023
Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Signed-off-by: Balaji Vijayakumar <[email protected]>
@balajiv113
Copy link
Member Author

balajiv113 commented Jan 7, 2023

@AkihiroSuda - I am not getting this pipeline issue locally.
awesome_bot was successful.

EDIT: Looks like it ran fine now in CI.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@AkihiroSuda AkihiroSuda merged commit 25b137d into lima-vm:master Jan 7, 2023
@balajiv113 balajiv113 deleted the host_vm branch January 7, 2023 14:04
@abiosoft
Copy link
Contributor

abiosoft commented Jan 7, 2023

If I understand this correctly, with this PR the VZ driver can use either of socket_vmnet or vzNAT. Right?

@balajiv113
Copy link
Member Author

@abiosoft
yes that's correct

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

Successfully merging this pull request may close these issues.

3 participants