Hacker News new | past | comments | ask | show | jobs | submit login
Daily Driving FreeBSD (lilysthings.org)
62 points by todsacerdoti on Nov 14, 2023 | hide | past | favorite | 33 comments



>For my filesystem I chose UFS over ZFS. Partially because I wasn't going to use any of the features of ZFS as I find them mostly useful only in servers but mostly because the ZFS option wanted to wipe my entire drive and I have 4 other operating systems on here that I'd rather not lose (Arch, NixOS, macOS, and Haiku if you're curious).

Pleasantly surprised this was addressed. My first thought after the mention of doing the install on a primary machine was "so did you just wipe all your data or what?". Seems there's some funky multiboot setup.

>Now this would be the point where I'd install i3 or openbox or something, but I noticed something in the handbook that caught my attention, Chapter 6: Wayland. I knew I had to use Wayland because fuck X11.

I think I would've felt the same here.

Fun read overall. I've never really wanted to run FreeBSD before, but it seems a bit more likely I'd try it (on a secondary machine) after reading this.


Netflix also uses UFS on FreeBSD.

People are always surprised to learn this because they assume ZFS due to their servers being content/data storage.

https://news.ycombinator.com/item?id=27555600#:~:text=We%20u....


The reason Netflix content cache appliances use one UFS file system per drive instead of ZFS (or any other RAID / volume management) is that they run at the edge of what the hardware can do and can tolerate failures up to and including data corruption (to a point). It's a distributed cache and the video container formats have their own checksums.

They are running close to the theoretical peak per socket memory and I/O bandwidth and UFS allows them to use non-blocking async sendfile() with hardware offloaded in-kernel TLS (iirc also with hardware packet pacing). Their webserver gets an HTTPS request, validates the request and starts streaming the data from a file on a UFS file system. Sendfile() on UFS can DMA directly from the buffer cache to the NIC. If there is valid buffer for the file range the NVMe SSDs can DMA to main memory and the NIC can DMA from main memory without ever having the bulk data go through the CPU. The TLS handshake is done the usual way on TCP sockets before the session keys are registered with the kernel allowing the zero-copy TLS send (and receive). The bulk encryption is also offloaded from the CPU to the ≥100Gbps NICs. The mbuf chains handed to the NIC driver contains the key material and ciphersuite and references to offsets in pages of the buffer cache. The FreeBSD base system OpenSSL as well as the default version of the OpenSSL port are built with support for in-kernel TLS.

ZFS has to perform multiple data copies to implement verifying reads and has it's own file system cache (the ZFS ARC) while UFS is tightly integrated with the kernel virtual memory subsystem. This means that ZFS has more overhead, but it can also do useful optimisations like splitting variable sized file system block of up to 1MiB into scatter/gather lists of small allocations that can be decompressed as needed which is often more useful than a faster memory-mapped or DMA access. For example ZFS compression allows me to fit four to five times as large PostgreSQL databases into main memory, because the databases contain lots of sorted data which compresses really well. Even the fasted disk I/O path can't beat no disk I/O at all. The CPU cycles to LZ4 decompress the data are cheaper than going from 128GiB to >512GiB per server.

It's impressive how far they went to push as many bits per seconds as possible with as little hardware as possible, but Netflix did it by accepting trade-offs that won't work most others e.g. if a disk fails they expect to lose its content and slowly redistribute the lost data from an other replica if was accessed frequently enough to be worth it. Their caching appliances are just running degraded until they're either too degraded to be useful or it's convenient to service/replace them since they're colocated all over the world. The redundancy is implemented at a higher level.

What makes Netflix special is that they run their own FreeBSD version that closly tracks the FreeBSD -current development branch and keep their local patches to a minimum by upstreaming their changes. By upstreaming their changes they don't have to maintain an ever growing patchset and the FreeBSD project gets valuable feedback on performance regressions and hard to reproduce bugs.


OpenBSD does wifi better without running a Linux VM, and setting up a desktop it's easier. No ZFS, and no Linuxemu, but you get another set of features, such as pledge/unveil, a much easier and safer upgrade path, more up to date Intel GPU drives, and stuff laptop like brightness keys working rightly from the kernel boot and not with a crude desktop daemon hack.


There is ongoing work in Freebsd as well with the new Iwlwifi driver, which hopefully will soon start to support n and ac.

https://wiki.freebsd.org/WiFi/Iwlwifi#Status


Agreed - it's counterintuitive, but OpenBSD works really well on laptops. Wifi, sleep, graphics all work out-of-the-box on more popular oldish models.

They encourage you to mail the system dmesg [1] with the make/model of the system and any known issues to help improve compatibility as well.

1. https://www.openbsd.org/faq/faq4.html#SendDmesg


I can haz blutooth?

https://man.openbsd.org/blueooth

kthxbaiiii...

(eddit: äye cänn't hear yoo! mee meee meee meeeaaoooo!)


Well, that's an advantage. If you knew how insecure BT is...


> I bought a Thinkpad [t480]… For my hostname I chose “dell-latitude-e5430”. I don't know why.

Wait, what would possess you to use that hostname?

It’s like buying a Honda Civic but referring to it as your Ford Focus.


My teacher used to have 2 cats. Their names were Cat and Dog. If you can't have some silly fun in your life, what's the point? :)


> what would possess you to use that hostname?

Probably “The Imp of the Perverse”.

It is also a RFC 1178 violation:

<https://www.rfc-editor.org/rfc/rfc1178#page-2>


Hmm, I rarely name my cars but I might start calling my Chevy (Volt) the Ford.


Sounds funny though xD


> This time however has been different. I've been using it basically full time for around 3 days on my laptop and I don't see myself stopping any time soon. So what changed? What's making it easier for me to use? Why didn't I give up? Why am I writing this when I have to be up in 6 hours?

It's not the FreeBSD, it's just that guy got matured. One more year and he deserves being FreeBSD user. Two years more and he will bless it. ;)


This makes me tempted to put something else than NixOS on my T430, like said FreeBSD...

But maybe I will do that, when I get more than one drive. Will see.



Why is this necessary? There is no paywall.


Maybe temporary HN hug of death


The wifi part is so bad. Just use (arch)linux.


Yeah, all of this to end up running linux on the side because you need Wifi...

But all in all, good for them.


WiFi is no fault of BSD. Vendors have only recently been acknowledging Linux and are finally pushing Linux blobs. However if vendors don't push FreeBSD binary blobs, what are you suppose to do?

If this was five years ago, WiFi was ghetto on Linux too.


> If this was five years ago, WiFi was ghetto on Linux too.

That's true of many wifi vendors such as Qualcomm, but Intel wifi (used by the post/author) worked just fine on Linux five years or even almost a decade ago in my experience.


There is https://man.freebsd.org/cgi/man.cgi?query=ndis&apropos=0&sek... which will be gone in 14.0

Don't know why. Used it once eons ago with some crappy USB-dongle, and it worked. Maybe NDIS in windowsworld is EOL?


[flagged]


Why not?


Just observing


Hahaha are you fucking serious? I can't read your blog because I use edge on my phone? Get over yourself!


  <script>if(navigator.getEnvironmentIntegrity!==undefined)document.querySelector('body').innerHTML='<center><h1>ha chromium user</h1><p>L</p><p>google is for losers</p><a href="https://www.mozilla.org/en-US/firefox/download/thanks/" style="text-decoration: none;"><h1 style="font-size:96px;" class="font-effect-fire-animation">Get Firefox</h1></a></center>';</script>
Anyway, it's a teenager who's taking his first steps into the world of computing. Obviously he has some irrelevant hard opinions :)


> teenager who's taking his first steps into the world of computing

Her steps. And you're off by a few years with the first steps.

People have options about Google ¯\_(ツ)_/¯ it's ok


His, he's a male


So Chrome essentially blocking out clients on “Web Integrity” is an acceptable opinion but a simple script to nag someone to use Firefox is not okay?


When I was a teen, my website had "Microsoft-free Fridays": My website wouldn't work on IE on Fridays.


I once worked on a site that was aimed only at Mac users, and this was back in the pre-Chrome days when Safari was the browser that was really pushing the web forward with stuff like Canvas and CSS animations, so we made maximum use out of every bleeding-edge feature.

One day I figured I'd test it in IE just to see how broken it was (I can't remember if IE even had support for transparent PNG yet) and when I tested it, our site would literally crash IE. As massive Mac fanboys, we decided this was a feature.


Funny but Chrome on Android opens the website without any issues




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: