Linux vs FreeBSD for Phoenix?

I know. But let be honest there is work to be done here. The system is really great but the community lack visibility. I would like to see the FreeBSD book equivalent for SmartOS.

I may do it in a couple year, but not right now.

3 Likes

I didn’t go through all of the thread, so excuse me.

I will focus on the main discussion of this thread: which OS is better for Phoenix / Elixir development.

I switch operating systems every two or three months by the simple fact that I enjoy testing other operating systems. I have tried about 80% of the mainstream Linux distros, but not very much of FreeBSD, after a couple of years using Linux I always come back to Arch Linux (or one of it’s distros) for two simple things: The Archwiki and AUR.

If you are a programmer looking to switch to a new OS one of the things you have to look for is a good package management system. That is why I love and I keep using Arch, beside many other benefits. I have a lot of software at my disposal which is carefully tested and updated.

In the last 6 months I’ve switched 2 operating systems, I’ve went from an Arch based distro to Debian, openSUSE, and back to an Arch based distro.

I’ve returned from one simple reason: I wasn’t pleased with the number of packages I had on those distros.
I might be picky, but for me it’s a good reason.

DigitalOcean has a good series of articles Getting Started with FreeBSD on their servers.

Part 1, A Comparative Introduction to FreeBSD for Linux Users doesn’t do a bad job of explaining some of the main differences between FreeBSD and Linux. I think the following quote from the summary paragraph does sum a lot of what Linux users often fail to understand, and perhaps why they cling/return to one Linux distro - the need for a consistent OS philosophy:

Treating FreeBSD as its own operating system instead of insisting on viewing it through a Linux lens will help you avoid fighting with the OS and will generally result in a better experience.

Or as said from Comparing FreeBSD and Linux from the FreeBSD docs:

This arrangement differs from Linux in a number of ways:

No one person controls the content of the system. In practice, this difference is overrated, since the Principal Architect can require that code be backed out, and even in the Linux project several people are permitted to make changes.
On the other hand, there is a central repository, a single place where you can find the entire operating system sources, including all older versions.
BSD projects maintain the entire “Operating System”, not only the kernel. This distinction is only marginally useful: neither BSD nor Linux is useful without applications. The applications used under BSD are frequently the same as the applications used under Linux.
As a result of the formalized maintenance of a single SVN source tree, BSD development is clear, and it is possible to access any version of the system by release number or by date. SVN also allows incremental updates to the system: for example, the FreeBSD repository is updated about 100 times a day. Most of these changes are small.

This blog post should give you a good idea of the simplicity of Installing Phoenix, Elixir and PostgreSQL on FreeBSD

The FreeBSD Handbook is a great place to start and good reference to keep using as it’s kept up-to-date, although you’ll find more specific information about parts of FreeBSD and processes elsewhere from manpages to blogs, books, youtube vids, etc.

When stuck, The FreeBSD Forums and StackExchange’s serverfault are great places for quick answers.

If you want to easily browse or search through the thousands of packages and ports that FreeBSD has available for it, you can do so at FreshPorts or obviously within a FreeBSD install itself.

As an aside, I should also note that not only is much of the userland in OS X similar to FreeBSD’s, part of OS X’s kernel is from FreeBSD - Kernel Programming, BSD - as one of the co-founders of FreeBSD was at Apple from 2001 to 2013 (now at iXsystems who acquired PC-BSD in 2006, renaming it TrueOS, and in 2010 re-released FreeNAS rewritten using FreeBSD.)

Containers/jails certainly have their uses, but for working with Elixir and Phoenix Framework, especially in a production environment, my opinion would be to avoid them and focus on the OTP and how it natively scales, and look at use of containers/jails where security matters on the edge of your network, in firewalls, reverse proxies.

5 Likes

I agree with you DianaOlympos

It’s great to see SmartOS, Illumos etc develop, and not only because its engineers are responsible for some of the great recent additions to FreeBSD, but because alternatives that keep FreeBSD on its toes are always needed.

But at this time, when checking off the usual criteria for choosing a dev and production OS - from user base (WhatsApp to cloud/server providers like Digital Ocean that offer easy to create and configure cheap FreeBSD servers) to an active supportive community (including up-to-date docs to forums and howtos) to the availability of a huge number of packages and ports as well as the option for Linux Binary compatibility, I think FreeBSD is the obvious pick for a startup or company wanting to scale with stability and security that Linux distros rarely can match if they can at all.

For cutting edge stuff that hasn’t yet made it into FreeBSD, if you need it, then I suggest SmartOS/Illumos or a Linux distro alternative.

Uh, for note, Illumos can run native Linux code (at faster than linux speed). :wink:

I think it’s important to keep proper perspective just because dude X ported something from Illumos to FreeBSD it does not mean it is as stable, performant and well tested as the original. A lot of original SUN engineers are involved in the Illumos ecosystem and very few are involved in various ports to other systems.

Sure, but FreeBSD doesn’t rush to integrate the ‘latest and greatest’ like Linux distros often do to differentiate their distro from others - it only integrates features from other OSes with a view to improving the overall OS, whether for performance or security or feature set, which means lots of testing, better audits, and the ability for users to downgrade to a previous version easily if necessary.

The FreeBSD community certainly isn’t reliant on ex Sun engineers and SmartOS/Illumos to improve - it gets improved from a much larger range of people, including cross-pollination from the other BSDs.

That doesn’t mean FreeBSD is perfect, but its community makes sure it is steadily improved from release to release, which is why it was chosen by WhatsApp to Netflix etc - for feature set, stability, and security.

When SmartOS/Illumos etc have the track record of high production deployments that FreeBSD has, using comparable/same features, and as large a community of users/committers, and available docs etc, then more people will look at it.

But as it is now, with regular releases, great features, stability, security, and scalability, and a large supportive community, up-to-date docs, etc - FreeBSD is an easy pick for someone that may want to build just a website or the next WhatsApp on it compared to choosing a Linux distro or SmartOS/Illumos.

2 Likes

Sure, and FreeBSD can run Linux code fast too - eg running a Linux distro within a jail with good performance.

But returning to the question in the title of this post, options like these and containers are, at least in my opinion, irrelevant for most if not all production environments needed for Phoenix.

1 Like

"When SmartOS/Illumos etc have the track record of high production deployments that FreeBSD has, " that is a bit humorous :slight_smile: Solaris and Illumos run the kinds of deployments that FreeBSD has never had :slight_smile: and is unlikely to ever have. This not intended to put FreeBSD down but just to give realistic perspective.

1 Like

I’m referring to FreeBSD deployments like WhatsApp, Netflix, Apache Foundation etc.

It’s easy to make such statements like:

Solaris and Illumos run the kinds of deployments that FreeBSD has never had :slight_smile: and is unlikely to ever have.

without giving examples, and please excuse my ignorance of such examples without you stating them here, but I’m not trying to engage in a OS pissing contest, but rather help community members here choose an OS that is best suited for needs for Phoenix/Elixir/OTP, in particular with regards to the title question of this thread.

It’s quite ignorant to think FreeBSD won’t be able to do the same as SmartOS/Illumos in the future as it integrates new features, and thus be deployed in most if not any environment types they are in, but that’s irrelevant now, as FreeBSD already serves enough small to large startups and companies that it’s proven itself more than capable for many years, and thus is a great pick for anyone in this community to use.

Can you refer the community here to one such high availability environment like WhatsApp or Netflix that SmartOS/Illumos has achieved??

I only ask so that they can be properly compared to FreeBSD as production server alternatives for the use of Phoenix, Elixir and the OTP.

Walmart, Goldman Sachs, Verizon, Airbus, P & G, BT, Industrial and Commercial Bank of China just some random companies pretty much 90+% of world’s largest companies.

1 Like

Except Jails in FreeBSD are for segmentation, not security, they are trivial to break out of. :slight_smile:

1 Like

Sure, and FreeBSD deployments can be found to be used by some of the world’s largest companies too.

But answering the title question of this thread, FreeBSD would be a better pick for most in this community to run Phoenix on instead of a Linux distro,.

And for reasons already listed above, FreeBSD would be a better choice over SmartOS/Illumos for most in this community to run Phoenix/Elixir/OTP on, which I think is proven by the WhatsApp to Netflix choosing it over alternatives.

1 Like

I agree jails are far from perfect, but I also think OS containers and even application containers are a distraction if not irrelevant for most developing with Phoenix, especially in the production environment.

1 Like

Some and most are 2 very different categories :slight_smile: . And the areas they are used in are also very different FreeBSD is pretty much at the edge only e.g. web servers. Google is using Linux for pretty much everything and it’s x times bigger than WhatsApp and Netflix combined so it’s a tough way to make an argument.

2 Likes

Sure, there’s no perfect OS for everyone, and I’m not trying to engage in a pissing contest of that type, but I think for all the reasons I’ve listed above, FreeBSD would be a better choice for ‘most’ in this community, especially taking into account single and small team developers who do not have the resources of Google to build and nurse their own Linux distro.

As I’ve said before, if someone needs an edge case, then pick a Linux distro (perhaps for a unique hardware requirement) or SmartOS/Illumos (for a leading edge OS feature), but otherwise, choosing FreeBSD will give ‘most’ in this community all the features, stability, security, and support they need to go far, and should they find FreeBSD doesn’t do what they need, they will be in a good position to migrate to an alternative.

I used WhatsApp and Netfix and Apache Foundation as examples because they represent diversity of uses, but I could have also include Yahoo etc simply to show the FreeBSD should cover most production scenarios that Phoenix could be used for.

2 Likes

my 2 cents : yes FreeBSD is great, and yes use it. In the end, the SmartOS/Illumos and the FreeBSD communities are quite close.

About Jails : it is made for security from the get go, while Zones were made for segmentation with security too.

The problems of Jails is that there are still a lot of patch lingering around and not being accepted upstream that are needed to bring them up to speed with Zones, especially concerning networking and ressource usage.

Now, i use a freeBSD for my server right now. I would use SmartOS if i had to handle a dozen hardware machine or need to build an infrastructure on top of it.

If you have a handful of hardware servers and not a lot of different loads/jobs to run on to it, use a FreeBSD. If you want a DC/OS or a container scheduler on top of it, use SmartOS.

If you have a strong preference for any of them, go for it.

You can also choose a Linux. Your pick. I am not always a fan, but they have a deep amount of knowledge floating on the web to help. FreeBSD is catching up, mainly due to DO offering them, but SmartOS is still far behind.

It all depends of your engineering needs and constraints.

3 Likes

I’ve been using Erlang+FreeBSD combo for about 3 years now with no issues whatsoever. It’s a rock-solid, battle-hardened (WhatsApp: Half a billion unsuspecting FreeBSD users) foundation you can safely count on.

2 Likes

Some of the most prominent Erlang projects of recent have been hosted on BSD infrastructure. What’s App is one, but there are others.

1 Like

Netflix uses FreeBSD exclusively - all that video streaming - all that reliability - all that concurrency
Netflix has at least 37% share of internet traffic in North America
Go with success!

before you start read FreeBSD Storage Essentials, FreeBSD mastery ZFS

https://www.freebsdmall.com/cgi-bin/fm

FreeBSD pdf
ThecompleteFreeBSD.pdf
AbsoluteFreebsd-2ndEdition.pdf

1 Like