> I doubt a highly tuned Linux box will be slower than the equivalent FreeBSD one.
That tracks but there's been a lot of work being done on FreeBSD's stack as well.
Most people are aware about the contributions Netflix has made to FreeBSD; they say their FreeBSD-based CDN streams terabytes per second [1].
In addition to the basic network stack, FreeBSD can load additional stacks like RACK TCP [2] stack (using Recent ACK, PRR, etc.) that can be loaded as a module and selected per-socket or as the system default. This is the re-written stack that Netflix uses after they helped develop it.
It seems that FreeBSD is kind of a testbed for new network implementations like Netgraph [3], a graph-based networking subsystem that enables modular, real-time packet processing inside the kernel and Network Offload and Socket Splicing (SO_SPLICE) [4] that enables kernel-level TCP proxying, resulting in reduced CPU overhead and eliminating unnecessary data copies.
I'm not usually into networking but this stuff sounds very interesting.
[1]: "Case Study: Maintaining the World’s Fastest Content Delivery Network at Netflix on FreeBSD" - https://freebsdfoundation.org/netflix-case-study/ (PDF).
[2]: "The RACK-TLP Loss Detection Algorithm for TCP" - https://datatracker.ietf.org/doc/html/rfc8985
[3]: "Inside FreeBSD Netgraph: Behind the Curtain of Advanced Networking" - https://klarasystems.com/articles/inside-freebsd-netgraph-ad...
[4]: https://klarasystems.com/articles/network-offload-and-socket...