News for hackers. Stuff that matters.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by bl4k on Tuesday August 03, 2010 @02:44AM (#1570356)
I have been an OpenBSD and FreeBSD user, as well as minor contributor, since the mid-90s. All the answers here are good, and I would like to add:

* FreeBSD is on the cutting edge of performance. Because it is a total OS (as opposed to just a kernel), performance improvements are made and integrated into the binary packages and ports build options of common packages. FreeBSD was one of the first operating systems to implement kqueue, which is now available on OS X. This was part of the reason why for years FreeBSD dominated high-performance web serving. If you asked this question 5-10 years ago, the answer would simply be 'FreeBSD performs a lot better than Linux with web serving', but that is not as true today since Linux has caught up in the 2.6.x branch (with epoll). For more info see the classic: http://www.kegel.com/c10k.html

The good servers like nginx and varnish take advantage of these performance benefits that FreeBSD offers.

(there was a similar system here with the virtual memory manager, while the Linux kernel struggled with this issue ~01-02 FreeBSD was miles ahead). FreeBSD is the starting and development point for a lot of new technologies.

2. Everything is done the BSD way, from directory layout to the rc.x startup system. It is the same and uniform and integrated with the kernel and doesn't vary across releases. There is a single reference handbook, and POSIX compliance. I have always preferred the BSD way of file system layout, and that is what I have become accustomed to. (ie. /usr/local/ really is usr local).

3. The BSD's are a monolithic kernel (which Linux is today, mostly, if you choose to) which has performance implications. FreeBSD support kernel modules, but the monolithic approach is preferred. It is very easy to build your own custom kernel (I suggest you do for servers) and the defaults are include nothing and build what you need from there, which provides a very small, fast and optimized kernel image. Linux distributions tend to take a 'kitchen sink' approach, since they are aimed at people who don't want to compile and load a kernel module for device XYZ. FreeBSD places the onus on the user to know what they are doing - which forces you to understand the internals of the operating system and how it works. Linux usually has different distributions depending on the target, but FreeBSD is flexible enough to only have a single distro that can be customized from a 20MB install image through to a desktop system that will support your Chinese webcam when plugged in. It can do this without compromising on performance or bloat. I suggest you start FreeBSD with the minimal binary install plus the ports tree (the ISO is 50MB, install is about that).

4. You can take this one 'distro' and way of doing things across a multitude of architectures.

5. jemalloc - a virtual memory manager for parallel processing that outperforms Linux, see: http://people.freebsd.org/~kris/scaling/7.0%20Preview.pdf

6. The GCC compiler and toolchain are steadily being replaced by the less bloated and much faster Clang/LLVM which are part of Xcode and BSD licensed. It allows much better IDE integration, is modular and a lot lot faster than GCC. Clang/LLVM are already at the point now where they can compile all of FreeBSD

7. The TrustedBSD event auditing, ACL, stack protection, other security features and OpenBSM make FreeBSD orange book compliant in terms of security. OS X also has this (it is the same security model). This is important if you are in a corporate environment and need to stamp some certifications or meet compliance regulations with the systems you choose.

8. Zen and VMWare virtualization support available in kernel. Virtualization support is very good in Linux, but the virtualization providers have been supporting FreeBSD for a while now, and have hired core team members to develop software. EC2 needs better support, but I am sure it is coming.

9. Linux has abandoned the development branch approach (ie. 2.7.x) and instead trails along 2.6 releases with releases candidates. With FreeBSD you can be assured that STABLE is stable and CURRENT is current. Releases are taken very seriously, as can be seen by FreeBSD 5 (one of the best OS releases every, IMO) took years to finalize. Point releases are binary and API compatible with .0 releases (ie. 5.5 binaries are guaranteed to run on 5.0)

10. You have linux binary compatibility anyway, at near-zero cost.

11. A more liberal license to use in commercial environments (ie. if you sell a firewall, or an embedded device, no need to release your own code - Apple have done this spectacularly).

12. ZFS (works)

13. Excellent handbook that encompasses the entire operating system: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/

14. Average knowledge of a FreeBSD/OpenBSD community member is higher than Linux (personal experience) and since there is usually only one way of doing things, you will find consistant answers and advice on your questions or issues across the web.

15. FreeBSD hasn't had a default install, STABLE security advisory in ~10 years.

In conclusion, if you like to know what is actually happening on your server or machine so that you can tweak, optimize and better understand performance and other issues, BSD will almost force you into understanding it. If you are running linux and just downloading and installing binary packages, you are simply unaware of what is happening on your system (no different to running Windows, really). BSD will teach you the old school UNIX way of doing things, is consistant throughout and through just using it it will teach you a lot more about your system and operating systems in general than Linux.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by forkqueue on Tuesday August 03, 2010 @05:04AM (#1570571)
A reasonable summary, but one that demonstrates some misunderstandings of the Linux world. To deal with the issues point by point:

* FreeBSD has better performance than Linux? This is, as you almost concede, no longer true.

* Lack of kernel modules an advantage? Hardly. Linux loadable kernel modules produce no extra performance overhead, but make life a lot simpler for everyone. The only extra 'bloat' is having ~100MB of drivers of which you probably only need 10% or so. If this an issue for you (ie, you're running an embedded system) you can of course cut down the modules to only those required, or even compile into the kernel just as with FreeBSD.

* The GCC compiler and toolchain aren't optimal, and I fully expect a major Linux distribution to switch to Clang/LLVM in the not too distant future. If this is a success (and I expect it to be), I wouldn't be at all surprised to see most/all Linux distros switch. This isn't a Linux vs FreeBSD issue, this is GCC vs Clang/LLVM - a battle I believe Clang/LLVM will win.

* As far as I'm aware TrustedBSD offers no more features than SELinux, and the Linux ACL system, but maybe I'm showing my lack of BSD knowledge here.

* Xen and VMWare virtualization is there but not 100% in FreeBSD. They're rock solid on Linux, which also has KVM, a very viable alternative to the two.

* The development branch/stable kernel approach is irrelevant - people don't use Linux, they use a Linux distribution (OK, OK, a GNU/Linux disitribution :)). In most distributions point releases are binary and API compatible with .0 releases (RHEL 5.5 binaries are guaranteed to run on RHEL 5.0).

In conclusion, is FreeBSD good? Undoubtedly. Is it better than Linux? It's hard to make a case for that. It has less device support, less software support and a massively smaller user base.

FreeBSD is nice to tinker with, but it doesn't offer enough benefits to justify putting production software on it. It's great to learn about the old school UNIX way of doing things, but that's not what I want to be doing on a live server.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by bl4k on Tuesday August 03, 2010 @07:31AM (#1570781)
* That point about performance was more about FreeBSD being first with a lot of performance and security improvements. As I said, this argument was a lot easier 5-10 years ago but doesn't apply as much anymore.

* The Mono vs Micro kernel debate between Linux and BSD doesn't apply as much anymore since they both support both. With Linux is varies a lot between distro vendors. Vendor kernels also tend to lag behind the main branch (at least this is my experience, mainly with Debian and Fedora). I find that FreeBSD, as a distro, allows easier kernel optimization especially since the default kernel is tight. Again, this is something that on the Linux side of the argument is the responsibility of the vendors, who approach the issue by providing targeted server and desktop distributions (most do). You are right though that there is very little performance diff between Micro v Mono (see the classic debate from when Linux was announced: http://oreilly.com/catalog/opensources/book/appa.html). I have always preferred only having code on the server that is required by the system (code coverage), and the FreeBSD way of doing this is managed better than any of the Linux distros, IMO.

* As somebody mentioned below, the Linux kernel is very much tied to GCC and its toolchain. It is so tied to it that the Intel compiler uses the Linux kernel as a test for its GCC compatibility mode.

* A BSD port of SELinux is actually part of TrustedBSD, which has in-turn been ported to FreeBSD. There are a bunch of other things that TrustedBSD entails, I can't name them off the top of my head atm, but both SELinux and TrustedBSD line up with orange book

* You are correct that the stable/release cycle of Linux is more up to each distribution, but since there is a step between kernel and distro (which FreeBSD as a total operating system doesn't have) there is a lag there, and a risk of support ceasing (or patches/updates/support suddenly becoming a commercial service, as it did at Red Hat)

In the end it depends on how you define 'better'. It is tiresome to enter debates about benchmarks and features, it is what you are most comfortable with. If you want to hack at a UNIX operating system that is very neat and cool, FreeBSD is a very good choice. If you like knowing what every file and every command does on your system, and prefer a UNIX-like uniformity in how things are done, then FreeBSD is again a good choice.

I would thoroughly recommend all hackers try out FreeBSD and become familiar with it. It will alert you to why some things are done the way they are, and there is a very deep history in that operating system, so at times it feels like opening a time capsule.

Add to that, if you need an OS for commercial purposes, FreeBSD is free as in 'do whatever you want', which can also be an advantage.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by loewenskind on Tuesday August 03, 2010 @06:16AM (#1570687)
>The GCC compiler and toolchain aren't optimal, and I fully expect a major Linux distribution to switch to Clang/LLVM in the not too distant future.

Have you looked through the Linux kernel code? There is a lot of gcc specific stuff in there. I don't think the Clang change will be as fast as you think.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by rbanffy on Tuesday August 03, 2010 @06:41AM (#1570724)
The worst that can happen is porting GCC features over to a GPL-licensed Clang fork.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by praptak on Tuesday August 03, 2010 @09:23AM (#1570995)
It could actually be quite bad - maintaining a large featureset like this in a fork would probably cause major problems. Fortunately GCC compatibility is listed as one of the official goals of Clang.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by loewenskind on Tuesday August 03, 2010 @08:07AM (#1570851)
It's not a catastrophe. It's just more work. Which was my point.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by bobdole2695 on Tuesday August 03, 2010 @05:28PM (#1572819)
I find that last line entertaining considering I feel the exact opposite way about linux and the utterly chaotic development model they employ.

I always feel like I'm building my castles on quicksand.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by fjarlq on Tuesday August 03, 2010 @03:14AM (#1570411)
Re: "15. FreeBSD hasn't had a default install, STABLE security advisory in ~10 years."

You make several good points here, but I'm not sure what you mean by that one.

Consider the most recent advisory, FreeBSD-SA-10:07.mbuf, listed here:

http://www.freebsd.org/security/advisories.html

default install: yep, kernel mbuf code

STABLE: yep, FreeBSD 7.1 and later

security advisory: yep, privilege escalation

in the past 10 years: yep, three weeks old

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by bl4k on Tuesday August 03, 2010 @07:06AM (#1570751)
You are correct. It would be more accurate to say 'remote attack' with an up-to-date stable release. The point could be scaled back to say that FreeBSD has undergone extensive peer-review and security auditing to the point that the stable branches have not seen a remotely exploitable security vulnerability in a long time.

That said, FreeBSD doesn't excuse sysadmins from not being vigilant with monitoring advisories and keeping their systems up to date. Nor does it prevent vulnerabilities being introduced through installed userland software or other applications.

One benefit would be that with patches and ports, you can patch any vulnerability in a service without being forced to upgrade to a new version that might have incompatibilities with your system or that might introduce performance degradation.

You see this all the time with PHP, sysadmins run binary upgrades on the packages because of a security vulnerability, only for the website to spit out a bunch of warnings about functions that have been deprecated in the new version.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by fjarlq on Tuesday August 03, 2010 @05:16PM (#1572780)
Okay, yeah, I can't remember the last time there was an advisory about a remote hole in a default FreeBSD build.

You credit FreeBSD's "extensive peer-review and security auditing" for this... do you have more information or links about that? I know the FreeBSD folks have been proactive about fixing security bugs, and conservative in their default build design, but I haven't heard about their peer-review and auditing.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by ax0n on Tuesday August 03, 2010 @12:05PM (#1571635)
This post is awesome, but I do have to argue your point on FreeBSD 5. The release might have been very structured, but for me it was a gigantic clustercoitus that caused me to turn my back on FreeBSD.

Just one of the many annoyances: The package manager would attempt to use gunzip on the new packages which had been tar/bzipped and thus binary package installation was completely borked for a good while after release. I ended up having to manually patch the package utils.

I agree with everything else. It's amazing how Open, Net and FreeBSD work together on a lot of things, particularly hardware support and userland performance. The BSD Way (all of it) is a great comfort to me, and knowing The BSD Way ahead of time really helped me out when I went to start working on big enterprise platforms like Solaris and AIX. I fear many GNU/Linux admins would take much longer to adapt to how things are done on those platforms than someone with a really solid BSD background.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by n2dasun on Tuesday August 03, 2010 @01:02PM (#1571840)
I know this doesn't add to the discussion, but I wanted to thank you for the term "clustercoitus". I hope you hold no copyright on it.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by ax0n on Tuesday August 03, 2010 @03:16PM (#1572353)
if you grep the internet, you'll find I'm nowhere near the first or only one to use it.
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by peterwwillis on Tuesday August 03, 2010 @09:45AM (#1571070)
With FreeBSD you can be assured that STABLE is stable and CURRENT is current. Releases are taken very seriously, as can be seen by FreeBSD 5 (one of the best OS releases every, IMO) took years to finalize. Point releases are binary and API compatible with .0 releases (ie. 5.5 binaries are guaranteed to run on 5.0)

Each time i've tried a "stable" release right out the gate (5.0, 6.0, 7.0) I have had numerous random crashes and bugs in the default install. I always have to wait a few minor revisions for the bugs to be worked out. Of course, i'm a Linux guy, so maybe i'm doing something wrong.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by nailer on Tuesday August 03, 2010 @08:29AM (#1570885)
> 15. FreeBSD hasn't had a default install, STABLE security advisory in ~10 years.

Do you use the default install? Even OpenSSH (which would be in the default install of Linux) is from ports IIRC.

Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by sigil on Tuesday August 03, 2010 @12:12PM (#1571665)
No, OpenSSH is a part of the base system, and is included in a default FreeBSD install. http://svn.freebsd.org/viewvc/base/stable/8/crypto/openssh/
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by hyyypr on Tuesday August 03, 2010 @04:56AM (#1570562)
Thanks a lot for sharing so accurately. Now all I want to so is get rid of my ArchLinux and give FreeBSD a shot :).
Re:Ask HN: I'm a Linux guy. Tell me about all those BSDs by vegai on Wednesday August 04, 2010 @03:24AM (#1573892)
Or perhaps do this so you'll have less regrets:

    sudo pacman -S virtualbox-ose