Linux vs FreeBSD for Phoenix?

How long have you been using FreeBSD?

Reckon you could put together a Elixir-FreeBSD wiki/info page for us? :slight_smile:

1 Like

Iā€™ve been using it for a few years now.
Erlang & Elixir deployment is just as boring as it is on Linux.

ā€“ The end.

3 Likes

I donā€™t think itā€™s boring when it comes to deployment and/or any potential benefits :icon_razz:

2 Likes

One downside of Linux is that most distributions ship terrible, hacked together amateur code and ill-thought out monstrosities like systemd, pulseaudio and so forth. This is getting markedly worse over time and infecting more and more distributions.

By comparison, FreeBSD is clean and OpenBSD is immaculate. Neither one has the sexy latest features, but for servers, thatā€™s a strong plus. And, programs are frequently faster and have less jitter on the BSDs, owing to better networking stacks, better drivers, and better schedulers.

5 Likes

Sure, but honestly, when itā€™s just a matter of git clone/wget/rsync & using mix,
Thereā€™s no real difference with Linux systems :wink:
Of course, administrating a FreeBSD is way more pleasant with a far more documented manual.

5 Likes

FreeBSD has a network stack that is more reliable under heavy loads and has better tooling for tuning. If you have a machine with dozens of cores and youā€™re trying to saturate the network cards with millions of socket connections(like WhatsApp) then FreeBSD is a natural fit.

6 Likes

Correct me if I am wrong, but afaik WhatsApp uses Erlang on FreeBSD for its messaging servers. Seems to me very stable.

https://blog.whatsapp.com/196/1-million-is-so-2011?

7 Likes

Iā€™d like to add that I think FreeBSD is a more superior operating system, mostly because of stability and documentation. Iā€™ve had a few production CentOS and Debian Linux systems break on me for no apparent reasons in the last 5 years. Iā€™ve started using FreeBSD 4 years ago and have never had any major issues, servers all running stable.

However, if youā€™re used to Linux and good at managing Linux servers, just use that.

As long as you install Elixir itā€™s a win for our community anyway :smiley:

7 Likes

For those of you interested in promoting FreeBSD, you are welcome to start a Wiki with info (and reasons etc) about using it with Elixir here on the forum if you like :slight_smile:

If youā€™re up for it, go ahead and start the thread and Iā€™ll make a wiki for you and add it to our list of stickies :slight_smile:

3 Likes

For myself, I think Iā€™m going to keep it in this thread for now and in the ā€œexperimentationā€ realm, since a Wiki sounds more like a dependable information and I canā€™t provide that as a beginner.
It would be great if someone with professional experience is willing to share their know-how in a Wiki though :slight_smile:

1 Like

EDIT: Misread

Also, better kernel polling, DTrace, better schedulers, integrated OS, ZFS, Jails. Those are options you donā€™t find in the GNU/Linux world. The network stack is faster and more reliable (as others have pointed out).

I run FreeBSD on my laptop, on my workstation and on my deploy servers. We run FreeBSD at work in production and we deploy Elixir and Erlang applications with a breeze. We are now moving forward to containers using http://www.tredly.com/

7 Likes

For desktop/laptop use, would you suggest something like PC-BSD or just rolling your own?

1 Like

@thinkpadder1 PC-BSD is fine and it has a lot of 3rd-party software available for installation but there is nothing wrong with plain FreeBSD. You can install a desktop environment like KDE or GNOME using the FreeBSD package manager. PC-BSD is friendlier to the end user though.

3 Likes

Here is a link to deploying Phoenix on FreeBSD 11-0-RELEASE on Googleā€™s Compute Engine. The setup uses nginx, Letsencrypt, Distillery and eDeliver.

8 Likes

Iā€™d recommend using FreeBSD over any Linux distro for a production environment for several reasons:

  1. Better integration of OS apps/utilities/libs
  2. Security audits/alerts/updates are thus more holistic
  3. Configuration just feels more sane and thought out
  4. Improved stability, based on the above
  5. Excellent features - from jails to network stack
  6. Great cross-pollination between BSDs - easy to a lib from another BSD in your preferred one.
  7. Linux compatibility
  8. Supportive community
  9. Bonus is, if you are using OS X, much of the userland/dir system, libs, etc, should appear familiar.

Itā€™s why the general trend appears for companies appears to migrate from Linux distros to FreeBSD for their server environment.

If you want a desktop environment, then Linux may be the best choice still, but PC-BSD (the last time I looked), has come a long way), but my preference would be for OS X unless you are doing scientific work that requires Linux.

Hereā€™s a link with a few of the big name organisations/companies using FreeBSD - from Apache Foundation to Netflix to WhatsApp: Welcome to FreeBSD!

Oddly, I find people new to Linux are often more apprehensive of learning and using FreeBSD, as many developers are of postgresql - choosing mysql over it, when my experience of Postgresql and FreeBSD are less frustrating, and FreeBSD much easier to keep up-to-date with changes/improvements and discuss solutions with the community.

If you want to build the next big thing, Iā€™d suggest choosing FreeBSD over any Linux distro for all the above reasons, but if thereā€™s something cutting edge that a Linux distro has that FreeBSD or any of the other BSDs canā€™t (yet) do, then go with Linux. Otherwise, FreeBSD will often take you further in regards to scaling, stability, and security.

6 Likes

/me has been a big FreeBSD user for decades, but nowadays Iā€™d recommend some Illumos derivative for all the same reasons, except Illumos containers are BSD Jails but done right. ^.^

4 Likes

Your post makes me want to try BSD :smile: the ā€˜bonusā€™ is pretty compelling to, especially if it means it would be easier to get into:

3 Likes

Illumos too, both Illumos and FreeBSD have the same root system type from the original BSD, thus the same filesystem and structure setup too, except Illumos has containers. ^.^

1 Like

Agree but sadly Illumos lack the documentation and tutorial that FreeBSD have.

I launched my own stuff to do more sysadmin stuff recently. I tried SmartOs/Illumos. Got stuck after 5 min. After 2 days of tryign to find answers, but only found dead link, switched to freeBSD. I will come back to Illumos/SmartOS for bigger things.

1 Like

Heh, most FreeBSD information works directly on Illumos as well, they have the same root system. The main difference in Illumos is that jails are baked into the kernel, into the very process struct itself, so everything is running in a ā€˜jailā€™, including the original login in the root jail. :slight_smile:

That design fixes issues that FreeBSDā€™s jails have, like non-segmented network, poor control of CPU and RAM usage, etcā€¦