tailscale / tailscale

The easiest, most secure way to use WireGuard and 2FA.
https://tailscale.com
BSD 3-Clause "New" or "Revised" License
17.59k stars 1.35k forks source link

FR: On FreeBSD use the WireGuard kernel module if loaded #11561

Open milesbarry opened 3 months ago

milesbarry commented 3 months ago

What are you trying to do?

I would like to see the if_wg kernel module used on FreeBSD

How should we solve this?

No response

What is the impact of not solving this?

I've seen reports that using the Go implementation of Wireguard dramatically reduces performance, and that using the kernel implementation resolves this.

Anything else?

No response

bradfitz commented 3 months ago

This is a little https://xyproblem.info/

The problem is performance on FreeBSD.

Your proposed solution is to use the kernel.

But Tailscale's wireguard is faster in userspace than the Linux kernel module: https://tailscale.com/blog/more-throughput

So the kernel isn't necessarily the answer.

Using better kernel interfaces on FreeBSD might be the answer.

milesbarry commented 3 months ago

Hi Brad,

Many thanks for schooling me on that one (not being sarcastic either). I actually read a post from NetBird IIRC comparing their throughput to that of Tailscale, and them showing a large performance win on their part. They mentioned they were using the FreeBSD kernel module, not the Go implementation. I also a few days ago spoke to people on your IRC channel about a performance issue I was facing, and they also mentioned Go being a possible bottleneck - hence my post.

TBF I think I've found out the issue being a P2P link between two EU countries. Both have gigabit symmetrical fibre - yet speeds were very poor (sorry would write the metrics but can't damn remember).

Anyway, I love Tailscale and very grateful that you're supporting FreeBSD.

Best wishes