FreeBSD vtnet0 tuning

Hello,

I am working on setting up FreeBSD VM to act as my personal cloud, you can see the github repo here:
http://github.com/sinner-/ansible-freebsdvps

One of the features is to act as an OpenVPN server and gateway. However on vultr the VPN gateway functionality is really slow for download speed! I could get less than 0.3mbps download using google speedtest and the ookla.net speedtest would not even load!

After some digging I discovered the problem was specifically the "RXCSUM" feature, disabling that made it go at expected speed.

You can test it on a running VM with: ifconfig vtnet0 -rxcsum #to turn off rxcsum

You can update /etc/rc.conf with the following:
ifconfig_vtnet0="dhcp -rxcsum"

I also disabled some other un-needed things for virtual machines:
https://github.com/sinner-/ansible-freebsdvps/commit/237d65d4e1d8bda4d7bcbc970e7e0a193994a867

So my /etc/rc.conf now looks like:
ifconfig_vtnet0="dhcp -rxcsum -txcsum -lro -tso4 -tso6 -vlanhwtso"

After disabling those NIC features, the download speed on google speedtest jumped to 40mbps, which is about the speed of my internet connection.

This should be baked into the vultr FreeBSD image default I believe.

Comments

  • Hi sinasa,

    Thanks for your feedback. We'll review this change and consider adding it to our FreeBSD image.
  • That's weird because I just deployed a VULTR instance using the FreeBSD 11.0 iso from freebsd.org and I'm not experiencing any slow download/upload speeds...I tried with the VULTR template and didn't experience any issue with that either.

    I'll play around with those options anyways and see how they effect my speeds.
  • Thanks for posting this! It resolved the problem I was having.

    I deployed a PfSense router on a VPS and I was having many issues with network speeds when using Openvpn.

    In the PfSense GUI I needed to go to System -> Advanced -> Networking

    Then I ticked the box for "Disable hardware checksum offload"

    Speed problem fixed!
Sign In or Register to comment.