Hacker News new | ask | show | jobs
by alwillis 98 days ago
> and approaches Linux performance in some areas (e.g. Networking)

FreeBSD has been the gold standard for networking features and performance for decades; not sure I'd agree.

> FreeBSD tends to have fewer features in almost all areas compared to Linux

I'm not sure FreeBSD has fewer features in total but on a new install, many of them are turned off; it doesn’t mandate what should be running. There's a lot beneath the surface to get into.

> FreeBSD Kernel and Userland developed together -- it has got that undefined "cohesive" feel

Definitely! It feels like a single entity rather than a collection of components.

> Has less layers of abstraction than Linux, gets the job done. Because there are fewer layers it's easier to understand what is going on and potentially easier to fix.

Agreed. You can tell the FreeBSD developers attitude is to compose features using what the operating system already offers instead of creating new things from scratch.

> Very simple daemon configuration via /etc/rc.conf

I'd say in a good way; quoting from "Service Management: init vs systemd" [1]:

The comparison is best understood structurally. [FreeBSD](https://vivianvoss.net/dictionary#freebsd)'s init system is composed of precisely five elements: shell scripts, one library, one configuration file, one ordering utility, and the shell itself. Each is inspectable, replaceable, and debuggable with tools that predate the engineer using them.

[systemd](https://vivianvoss.net/dictionary#systemd) is composed of, well, rather more. The binary count stood at 69 in 2013, which prompted some concern. By 2024, it had doubled. The project absorbed fifteen distinct tools that previously existed as independent, single-purpose programs, each maintained by specialists who understood them intimately.

[1]: https://vivianvoss.net/blog/init-vs-systemd

1 comments

>> and approaches Linux performance in some areas (e.g. Networking)

> FreeBSD has been the gold standard for networking features and performance for decades; not sure I'd agree.

This is the accepted wisdom. But reality on the ground is that Linux has probably surpassed FreeBSD in this domain too. With bpf programs making dynamic packet steering decisions in kernel space, io_uring, support for every hardware networking enhancement under the sun and $$$ being spent by everybody on the Linux networking stack (to speed up AI training or supercomputer clusters for example) I doubt a highly tuned Linux box will be slower than the equivalent FreeBSD one.

(P.S. I'm not a networking expert. This is my assessment though. Someone well versed with networking on both FreeBSD and Linux should confirm on this !)

> 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...

Thanks for the detailed response. Gives me a list of some cool things to explore and learn about !

Every year in various conferences and every new major Linux cycle there are new innovations in the Linux network stack too. To do a true comparison it would be fair to see what innovations exist in the Linux networking stack that have not yet been implemented in FreeBSD. Yes, networking is FreeBSD's pride and joy but Google, Intel and others have done a lot of work on the Linux network stack too (which should not be underestimated).