-
Notifications
You must be signed in to change notification settings - Fork 290
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
BSD: add kqueue support #387
Conversation
Fedora job will fail because F36 is using OpenSSL 3.0. Fixed in #386.
Edit: not needed anymore, see below. |
I have some older machines with dual Ethernet ports I could convince to run FreeBSD. Results from a VM should indeed be taken with a very large grain of salt. |
kqueue setup is now reduced to a single syscall thanks to iperf3 benchmark
|
The difference is more significant on OpenBSD (same limitations — it's a similarly configured virtual machine).
|
d30a588
to
42a1a60
Compare
I split There's a small amount of copy-pasted code in functions like Getting rid of it requires introducing more "public" functions and more calls between translation units. I didn't think it to be worth it, but if you'd rather not have duplicate logic, let me know. |
d37beee
to
2d79077
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. I will try it out on FreeBSD on bare metal first, which will probably be next weekend.
Ok, tried it on FreeBSD on two identical nodes with a gigabit Ethernet switch between them. I'm not trusting iperf results anymore since I got this:
I've rerun the tests, there's a standard deviation of a few Mbit/s. I don't know why the direct connection is slower. Anyway, no regression for your patch, even a ~7% boost in performance (although I would take that with a grain of salt). |
Similar to #266, but for FreeBSD/OpenBSD/NetBSD/macOS.
event.c
is in need of splitting into multiple files. I'd rather do that in a separate PR.Performance
It would be great to test this on physical machines with a fast network between them, if only I had the hardware. So here are results for a FreeBSD VM (13.1) on a Linux desktop (5.17.5).
Profiles
Start tincd, run 30 seconds of
iperf3
, stop tincd.select
kqueue
Baseline
Direct connection, no tincd.
epoll
+select
epoll
+kqueue
wrk
results are very unstable and could easily be swapped the other way. The only real difference I'm seeing are somewhat lower latencies withkqueue
.