Why I Love FreeBSD

80 points by draga79 a day ago on lobsters | 21 comments

radim | a day ago

It's ages since I used FreeBSD on desktop. But to stay true to my "background" it's shame PostgreSQL didn't come up - FreeBSD with PostgreSQL and jails/ZFS is still my favorite stack.

Historically big reason was also much more predictable scheduler.

reezer | a day ago

Also no FreeBSD on desktop in ages here..

I very much agree. It's such a nice and solid stack. The one thing that always has me introduce FreeBSD at companies (from tiny to large) is PG. And I'm in general not the die hard fan of any software, but that stack just works so well.

That copy of what really works for ZFS+PG is really old now. There's sadly some off information floating around, so look at official docs.

That combination is even better if you use extensions (like postgis) and want to get around that whole "oh I only get that old PG and I could use that third pary repo, but it doesn't have that extension my app depends on".

Just so nice to pick and choose in a stable and sane manner. And setting up poudriere to have your own packages is also such a breeze. Meanwhile it feels like every cloud providers secret killer feature is hosting a docker registry for you because it is (used to be?) such a hassle.

Oh and speaking about cloud providers, running your own PG is just so much nicer, especially when it comes to major version upgrades. Again with FreeBSD standing out no matter which approach you choose.

miguno | a day ago

Why is Postgres a good match for FreeBSD in particular?

reezer | 23 hours ago

I thought I wrote that? :D

To me it's essentially ZFS and especially configurability of the ports system. I have yet to find a Linux distribution where upgrading PG especially with extensions isn't a huge hassle. Given that even huge cloud providers seem to struggle severely with that topic and that so far I haven't seen a Linux distribution that isn't at least somewhat messy on that front I don't know a better choice.

And that despite these things not having much to do with the underlying operating system. There is nothing preventing one from doing that on Linux, but so far I have seen a system allowing that. Maybe Nix? But with Nix it always feels like I need to learn essentially a whole new OS and way to run it whereas FreeBSD is more a "it's just Unix". That said I really need to get around learning Nix, so maybe that might be another option. From what people say it gives me what the ports/packaging system of FreeBSD provide. Maybe Gentoo is another contender there, but I haven't used that in decades and I don't know what the story of building binary packages is there nor do I have much experience outside of university for non-desktop setups.

Mostly comparing to what people use these days in larger setups. Debian based systems (largely Ubuntu) and RPM based systems (largely RHEL derivates). Of course one can look at Kubernetes Operators and stuff, but those always feel like ways to make a DB admin's life harder and systems more complex for relatively little gain. They have a bit the problem with "it's HA as long as everything goes well".

Basically it gives me a combination of:

  • Stable OS with clear support lifecycles (in case you only looked at it from the distance: Basically the major versions are those that count here, the small ones are your just "restart the system")
  • Latest PG or also very old PG
  • No need to mess with third party repos
  • Good support for third party extensions, also up to date or old, in any combination you like
  • All upgrade paths work well (dump restore, pg_upgrade, and of course logical replication) even with extensions, and close to "day 1" of a release

Usually I have to choose between those in some manner. ZFS is a good fit for many jobs as well, but everyone has that nowadays. And you get all the bonuses that are nice like a sane firewall, actually multiple, jails, a simple system, well documented, modern, but stable system, etc. But there are many options for those as well.

Also ZFS of course isn't the best choice if all you care about is raw throughput. But you certainly can do a lot better than the default configs with very minor config changes and can certainly also run pretty write heavy loads on it. You just need to tell PG the stuff that ZFS is already doing. But that's a question of use case. I am talking about normal to heavy activity User DB for web and mobile apps. With some extensions like for GIS (for some reason that keeps following me through my career), fulltext search, etc.

Also just to be clear: This is not meant to be an ad. Not some die hard FreeBSD fan. And I don't really care too much about where people run their databases or what OS they use, when I don't need to administer it. So this is certainly not to say "FreeBSD is better than Linux" claim or something like that.

So in short: Less of a killer feature per se other than maybe ports/packaging, but just a couple of things that work extremely well and robustly, don't get in your way or add a lot of complexity. Certainly not things that couldn't be replicated. But while I have looked (not too thoroughly) I so far didn't find anything where I can feel as confident about a DB server setup.

atmosx | 21 hours ago

I run Postgres on gentoo for self hosted apps. I don’t remember any details because upgrades are uneventful. I just follow the “comments” after the upgrade and just works… it runs on ZFS as well.

dijit | 2 hours ago

Ok, wow, I had a worse experience with ZFS and PG than you, the throughput just wasn’t there.

I chalked it up to the idea that pg likes to do in-line modification of the row (not-before/not-after TXID column metadata for each row) and since ZFS was CoW it would amplify the writes.

Bearing in mind that I tried many tuning parameters- I could consistently make the database fall over with enough updates, so we went with XFS on Linux, which performed beautifully.

Maybe my scenario was worsened somewhat by using pre-compressed binary objects too, and disabling compression on the TOAST table.

vagos | 23 hours ago

This post makes it sound like FreeBSD is ages ahead of Linux and does everything perfectly. What's the catch?

cmcaine | 22 hours ago

The companies developing FreeNAS and TrueNAS both moved from BSD to linux. There's an interview somewhere with one of their engineers, I think.

Less hardware support and a smaller community can mean more fiddling to get hardware or software to work on BSD that just works on linux.

fuzzy | 12 hours ago

… an interview somewhere with one of their engineers, …

You may be thinking of this April 2024 article in Blocks & Files:

Discussion here: https://lobste.rs/s/c711sj/ixsystems_no_one_is_being_marooned_by

Kris Moore is also mentioned in Reddit discussion of Stefano's post; there's a link to a 2024 quote.

cmcaine | 6 hours ago

I was, thank you.

fuzzy | 12 hours ago

The companies developing FreeNAS and TrueNAS …

For clarity: FreeNAS Is Now TrueNAS Community Edition | Open Source NAS

atmosx | 21 hours ago

No docker (that alone is a deal breaker for most), slower overall, lacks HW support. Other than that, it makes for a pretty stable system with scheduled release cycles and outstanding documentation.

Technically the firewall facilities are better than Linux: PF is easier and IPFW alongside dummynet (is it called dummynet?) are more powerful than anything available on Linux. It is used a a free alternative for advanced ISP/BigOrg level routing.

ZFS on Linux has some bugs and issues around encryption / decryption and some other issues that come up when there is not enough RAM and ARC is enabled. ZFS on FreeBSD does seem to have neither of these issues.

atmosx | 16 hours ago

No docker (...)

Actually, podman might be FreeBSD ready soon: https://podman.io/docs/installation#installing-on-freebsd which IMO, could lead to much higher adoption as a dev/desktop machine.

fuzzy | 12 hours ago

ZFS on Linux

Which version(s) of ZFS?

Also, recently added: https://github.com/openzfs/zfs#supported-kernels-and-distributions.

thomas0 | 19 hours ago

One catch with FreeBSD that I've personally encountered is limited support for the latest hardware features (drivers).

My experience from a couple of years ago was that my new intel WiFi card was painfully slow (only a couple of MBits/s iirc). It led me to find that the intel WiFi drivers at the time didn't support n/ac/ax WiFi operating modes. I think the situation has improved since then, but it made me choose to go with Linux instead.

I might revisit FreeBSD next time I'm looking to install a new operating system.

fuzzy | 12 hours ago

… intel WiFi drivers at the time didn't support n/ac/ax WiFi operating modes. I think the situation has improved since then, …

FreeBSD-CURRENT manual pages:

thomas0 | 12 hours ago

Ah that's good to know, looks like freebsd 15 added support for n/ac modes. Though there's a caveat there:

802.11n/ac is only available on the 22000 and later chipset generations.

I have an intel ax200, I have no clue how to check the generation of that product. The intel spec page doesn't list the chipset generation on the product.

EDIT: I still don't know how to check the chipset generation on linux, but, I found https://wiki.freebsd.org/WiFi/Iwlwifi#Supported_Hardware which lists my card (22000/AX200) so I think my card just made it for supporting newer operating modes. Thanks a lot for that pointer @fuzzy

adventureloop | 5 hours ago

In my testing I can do 700-900 Mbit with ax201 (and I think 200, but the difference is minimal) using the iwx and iwlwifi drivers.

nortti | a day ago

I got a new desktop last May (my first from-new-parts build), and took the opportunity to select hardware with FreeBSD support in mind. I'd previously ran it from 2014 to 2016, on my then-primary computer (an EeePC 701 – long story), but when I upgraded to a ThinkPad T61p in 2016, I found the thermal management to not be usable for me, and so went back to Linux.

One thing that stuck out to me, not having used FreeBSD since then, was how a lot of the small friction and pain points I remembered were now solved: the locale is UTF-8 by default, no need to manually wire up a symlink for TLS certs with ports, etc. It's still very much the system I remember, but just more polished.

hongminhee | 2 hours ago

The argument that BSD licensing protects project independence better than GPL is interesting but I think it misidentifies the cause. The mechanism by which companies steer GPL projects isn't really the license itself; it's hiring the core maintainers, setting de facto standards through their own distributions, and controlling the agenda at working groups and conferences. None of that is GPL-specific. LLVM/Clang (permissively licensed) is heavily shaped by Apple and Google. Plenty of CNCF projects under Apache 2.0 are effectively steered by the big cloud vendors.

FreeBSD's independence looks more like a consequence of the FreeBSD Foundation's deliberate governance structure than anything inherent to the BSD license. OpenBSD is arguably the cleaner example: same license family, but it maintains its independence by being genuinely skeptical of corporate involvement as a matter of policy.

I love FreeBSD because it doesn't rename my network interfaces after a reboot or an upgrade.

Ouch.