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

Allow user to control NIC type when using virtualbox vm-driver #5959

Closed
davidnewman opened this issue Nov 22, 2019 · 1 comment · Fixed by #5960
Closed

Allow user to control NIC type when using virtualbox vm-driver #5959

davidnewman opened this issue Nov 22, 2019 · 1 comment · Fixed by #5960
Assignees

Comments

@davidnewman
Copy link
Contributor

I have noticed that with recent versions of minikube and virtualbox the network download and upload speeds when using the virtio NIC type are drastically worse than the native workstation speeds.

You can stop the minikube VM and change the NIC type of the NAT and see that the performance becomes almost the same as the workstation.

This is most likely an issue with virtualbox and not with minikube, but since this type of thing is possible, minikube should support allowing the user to choose a different NIC type for both the NAT and Host Only network devices.

I have put steps to reproduce here, and I have a Pull Request that I've already tested locally that I will attach shortly.

The exact command to reproduce the issue:

Create a VM using the virtualbox driver.

minikube start --memory=8192mb --cpus=6 --vm-driver=virtualbox

Go into the virtual machine:

minikube ssh

Create a Dockerfile with the following contents:

FROM ubuntu:18.04

RUN set -x \
    && apt-get update \
    && apt-get install -y python python-pip \
    && pip install speedtest-cli \
    && apt-get clean \
    && rm -rf /var/lib/apt/lists/* /tmp/*

CMD ["speedtest-cli"]

Build the docker image:

docker build -t speedtest-cli .

Run the docker image:

docker run --rm -it speedtest-cli

Observe the output (this is in my case):

Retrieving speedtest.net configuration...
Testing from Verizon Fios (173.77.165.21)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Pilot (New York, NY) [46.36 km]: 21.373 ms
Testing download speed................................................................................
Download: 9.65 Mbit/s
Testing upload speed................................................................................................
Upload: 8.65 Mbit/s

Exit the VM and then install the speedtest-cli command locally (assuming you have python and pip installed already):

pip install speedtest-cli

Run the speed test on your workstation:

speedtest-cli

Observe the results (this is in my case):

Retrieving speedtest.net configuration...
Testing from Verizon Fios (173.77.165.21)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Spectrum (New York, NY) [46.36 km]: 20.628 ms
Testing download speed................................................................................
Download: 67.41 Mbit/s
Testing upload speed................................................................................................
Upload: 59.93 Mbit/s

Note the massive improvement in speed.

Stop your VM:

minikube stop

Modify the VM to use a different network interface card (NIC):

VBoxManage modifyvm "minikube" --nictype1 82545EM

Restart the VM:

minikube start

Enter the VM:

minikube ssh

Run the speed test again:

docker run --rm -it speedtest-cli

Observe the results:

Retrieving speedtest.net configuration...
Testing from Verizon Fios (173.77.165.21)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Webair.com (Garden City, NY) [17.37 km]: 17.902 ms
Testing download speed................................................................................
Download: 54.12 Mbit/s
Testing upload speed................................................................................................
Upload: 53.50 Mbit/s

Notice that the performance is now much closer to workstation native network speeds.

The full output of the command that failed:

N/A as there was no actual failure.

The output of the minikube logs command:

N/A as there was no actual failure.

The operating system version:

MacOS Mojave 10.14.6
Minikue 1.1.1, 1.4.0, 1.5.2, 1.6.0-beta
VirtualBox 6.0.14

@davidnewman
Copy link
Contributor Author

/assign

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

Successfully merging a pull request may close this issue.

1 participant