Sunday, February 20, 2011

Why FreeBSD?

Choosing an Operating System


Mac OS X has some clear advantages as a personal workstation,
especially for non computer gurus. It runs MRI tools side-by-side with
commercial publication software such as Adobe, Corel Draw, and MS
Office. The Mac is also by far the easiest system for "normal" people
to manage.

FreeBSD (as well as its
derivatives)
also has some clear advantages over OS X, which may not
be apparent to the average user, so I will discuss some of them below.


One problem the Mac in a networked computer lab, is that some fMRI
applications (e.g. Caret, fslview) are Aqua applications on the Mac,
and hence can't be used effectively from a remote display. Aqua is
Apple's proprietary GUI, which is used for most Mac applications, and
works only on the console.


On FreeBSD, Linux, and other "pure" Unix systems, virtually all
graphical applications use the X11 networked graphics API, which means
they run the same on a remote display as they would on the console
(perhaps somewhat slower due to network bottlenecks, although this
usually isn't a problem.)


In case you were wondering, no, Apple Remote Desktop (ARD) and VNC
won't help with running Aqua applications remotely. There are two reasons:


  1. They take over the console desktop, rather than allow additional
    login sessions on a separate display, as X11 does.
  2. The graphics are terribly slow. ARD and VNC are designed primarily
    as administration tools, and as a way to access your desktop remotely
    on occasion, whereas X11 was designed to handle intensive day-to-day
    graphics work over a (reasonably fast) network.

FreeBSD as a Server and Desktop

FreeBSD, in my experience, has no peer as a server operating system, and makes a pretty good desktop system for most purposes.
The one weak spot I've run into is dealing with multimedia on the WEB. Browser plugins such as RealPlayer and Flash Player need frequent updates, and FreeBSD does not yet have a system in place for installing and updating them easily. For closed-source commercial plugins, FreeBSD must rely on the Linux binaries, and there is sometimes an additional lag between their release for Linux, and their usability on FreeBSD. All in all, though, FreeBSD runs pretty much the same software as Linux. Virtually any open source program that runs on Linux is also available for FreeBSD, and FreeBSD will run most closed source Linux programs as well.

Multitasking

FreeBSD's multitasking is far smoother than in any other OS I've used (and I've used a lot of them). It takes a remarkably heavy load to cause any noticeable degradation in response times. I routinely run computationally intensive programs in the background without suffering any discomfort with my desktop applications such as OpenOffice.org, Firefox, Thunderbird, etc. In most other operating systems, including OS X, desktop applications become choppy and sluggish when other CPU and memory intensive jobs are running. Running background jobs under 'nice' (to lower their CPU priority) can make a huge difference on most other platforms, but it's impossible to get every other user to use it consistently. On FreeBSD, the CPU scheduling is so good that the impact of 'nice' isn't very noticeable, but it's still a good habit to use it.

High Performance Filesystem

FreeBSD uses UFS2, a non-journalling, very fast, very reliable filesystem. Journalling filesystems, in my opinion, are overrated and more of a security blanket than a real benefit. This is not to say that journalling filesystems are "bad"; only that there are other ways to accomplish the same benefits of a journal. I'm thankful that FreeBSD has avoided following the crowd of operating systems adopting journalling filesystems. This demonstrates a commitment to facts and reason above marketing concerns.
For readers unfamiliar with this subject, the journal is a dedicated area of disk used to "buffer" write operations, instead of using RAM for this purpose. This means that write operations are immediately stored on disk, and in the event of a system crash, the journal can be replayed to quickly restore the integrity of the filesystem. Although journals are very effective in restoring filesystem integrity, many people don't realize that they aren't the only solution. The disadvantage of journalling, of course, is that disk is much slower than RAM, and writing data (or meta-data) to the journal and then again to the final location in the filesystem increases the disk head movements necessary to complete a write operation to a file.
UFS2 uses an alternative strategy, known as soft-updates. Soft-updates solve the problems that would make it difficult to repair a filesystem, without sacrificing the performance benefits of memory buffers. There are many articles about the details of soft-updates available on the WEB, so I won't get into details here. For a brief explanation, see the Wikipedia article.
Linux users who have worked with EXT2 often assume that FreeBSD's UFS2 will suffer the same painfully slow filesystem checks, because it doesn't use a journal. However, in the many years since soft-updates were introduced to FreeBSD, I've never seen a filesystem check take more than a few minutes, even on my largest RAID arrays, and I've never suffered a significant loss of data, even in the case of a sudden power outage.
Another common misconception is that journals greatly reduce data loss in the event of a crash. In reality, however, memory-buffers are synchronized to disk about every 30 seconds on a typical Unix system, so at most a fully journalled filesystem will save an additional 30 seconds worth of work. The real benefit and goal of journals is to alleviate the painfully slow (often over an hour long) filesystem checks/repairs that were common to older memory-buffered filesystems, such as EXT2. On that note, I would never advise Linux users to go back to EXT2. Of the filesystems available on Linux, those using journals are clearly the best. My personal recommendation is reiserfs, which in my experience, outperforms EXT3 by a wide margin. Of course, results may vary for a particular application, so if filesystem performance is a major concern, you should do your own benchmarking before you decide.

Ports and Packages

Another important feature of FreeBSD is the ports system, which makes it trivial to download and install (without searching the Internet) virtually all of the popular open source software, and some closed-source programs as well. With the ports/packages system, there is no need to search the WEB for software, and then figure out how to compile it on your system. Currently over 16,000 popular software programs can be found in the ports system, easily searched or browsed on the FreeBSD WEB site, and downloaded and installed with a single command. I've ported many MRI tools to FreeBSD to make them easier for myself and others to install. These ports can be found here.

Stability

I would argue that stability is the most important measure of a system with regard to minimizing computing costs. Talented systems administrators are very hard to come by, and consequently, their time is very expensive. Every system malfunction means time and money down the drain. The more stable your systems are, the more systems can be managed in a given number of admin-hours.
Obviously, system stability also affects the productivity of the users. The major goal in designing a computing system should always be to minimize work interruptions. This means minimizing system outages and malfunctions, and well as minimizing the impact of a system outage. Running FreeBSD will take care of the former. The latter is best served by distributing load as much as possible, rather the centralizing it. E.g., distribute server responsibilities among several systems, so that if one goes down, users will still be able to access the functionality of those that remain.
FreeBSD is by far the most stable operating system I've ever worked with. (And I've worked with a lot of them.) Most of my FreeBSD systems run uninterrupted between hardware failures and power outages. It's common to see FreeBSD machines that have been running well over a year without a reboot, and most outages are due to hardware or power failures.
Moreover, FreeBSD tends to dominate the longest uptime category in Netcraft's WEB surveys.
For current stats:
Most reliable sites
Longest uptimes
FreeBSD has also been the OS of choice by many popular WEB servers, such as yahoo.com, cdrom.com, and hotmail.com. For a history of the OS, see the Wikipedia article.

Support

One of the most common concerns of many would-be FreeBSD users is support. People often assume that since they haven't heard more about the product, it must not be widely used. Not to worry - the FreeBSD community is HUGE, and quite helpful. People often state that Linux is more popular than FreeBSD. While this is almost certainly true, it is not a valid comparison. FreeBSD is a complete system, more akin to a Linux distribution than to Linux in general, and probably has a larger user base than all but the top few Linux distributions. The term "Linux" refers only to the Linux kernel project, around which the many different Linux distributions are built. When it comes to user support, users of the same distribution can be much more helpful than someone just using the same kernel. I.e., RedHat users, despite their best intentions, are somewhat limited in their ability to help you with many questions about your Gentoo or Debian system.
The bottom line is, with FreeBSD, there will be a lot of people using the same complete system as you. Hardware support is very strong, problems are few, and solutions tend to be well publicized. Some companies also offer paid support services for FreeBSD.

FreeBSD and Windows Applications

If you need to run Windows applications as well, I recommend Win4BSD, the latest port of a virtualization system also known as SCO Merge and Win4Lin. Win4BSD is a solid commercial product at a very reasonable price. It's extremely simple to install and use, and runs Windows applications at nearly native speed. If you find this, or any other commercial product useful, please do buy a copy, to encourage future development of commercial applications for FreeBSD and Linux.

Win4BSD 1.1 running Windows XP on a FreeBSD 5.4 desktop

Win4{BSD,Lin} is comparable to Parallels for the Intel Mac, (another solid product) in that it allows you to boot Windows 2000 or XP as a "guest" operating system, which will run at nearly native speed within your FreeBSD host. Setup is a snap, and your virtual Windows system will be ready to use and fully integrated with the host the moment you finish installing Windows. Win4BSD leverages code from the QEMU project, but is much faster and easier to use than the qemu port. It's well worth the modest purchase price.
One advantage of Win4{BSD,Lin} over Parallels on the Mac is that a Windows session can be run from a remote X11 display (e.g. another FreeBSD system, a Linux system, or even a Mac). The GUI may be a bit sluggish over a network, but if the network is 100baseT or more, it's fast enough that it won't delay your work.
Parallels, on the other hand, is an Aqua application, so it can only be run on the Mac console. The GUI is visibly faster than Win4BSD, since Aqua always uses direct hardware rendering vs. X11's client/server model. However, I would consider this more of a cosmetic difference than a functional one. The Win4BSD graphics are fast enough, especially on the console of a modern FreeBSD machine. In theory, you could run Parallels remotely through VNC or Apple Remote Desktop, but performance of these systems is much slower than X11. Windows is unusably slow even over a 100 megabit network with VNC. Another disadvantage of VNC and ARD are that they take over the console rather than allow a separate login session as X11 does. Hence, no one can use the Mac console while you're remotely logged in over VNC or ARD.
If you want to be able to run Windows from a remote display, you'll want to get a FreeBSD or Linux system and run Win4{BSD,Lin}.
Note also that Mac OS X and Parallels are rather memory hungry compared to FreeBSD and Win4BSD, so you'll need to spend more on RAM for your Mac in order to run a Windows guest comfortably. A Mac with 512 megabytes just won't cut it for Parallels, while a FreeBSD box with 512 megabytes does just fine with Win4BSD.





Quick Comparison

Win4BSDParallels Desktop for Mac

Min requirements, Windows XP guest1.4GHz Athlon/Pentium, 512 megabytes RAMIntel Mac, 1 gig RAM

CPU speedNear nativeNear native

GUI responsivenessAdequateGood

Run from a remote displayYesNo

Ease of setupVery easyVery easy

Running Windows applications under a guest operating system
isn't quite as elegant as running OS X
native MS Office, Adobe, etc., but the Win4BSD system integrates very
well with the FreeBSD host.


Other alternatives for emulation and/or virtualization include
VMware, QEMU, and WINE. None of these are as easy to use or efficient
as Win4BSD, however.


WINE also operates quite differently. While the others emulate (or
virtualize) PC hardware, WINE attempts to emulate the Windows API
(applications program interface), allowing Windows programs to run
directly under Unix. This is a much more ambitious task than just
emulating hardware, given that much of the complexity of the Windows
OS must be duplicated. Not to mention that the API is constantly
changing. The advantage is that no Windows OS needs to be purchased
or running in order to run Windows applications. They simply run on
the same Unix desktop as other applications.

Despite the difficulty of the task, the WINE project has made significant progress, and some
major Windows applications can now be run under Linux, FreeBSD, and
other Intel based operating systems.

Reference:
http://www.neuro.mcw.edu/Ports/FreeBSD/why_freebsd.html

2 comments:

Anonymous said...

did you write both pages or did you just straight up plagerise the other page? shame, shame if the latter...

Unknown said...

I wrote the web site this was copied from, and have to point out that some of this material is seriously outdated.

Browser plugins are no longer much of an issue thanks to advances in geck media player, mplayer, and the like.

Win4BSD is now history. VirtualBox is a much better alternative, comparable to Parallels and VMware.

There are other issues, too numerous to mention here.

If you're going to keep this online, it should get a thorough overhaul.