40

TL;DR: FreeBSD has lower latency, and Linux has faster application speeds

 5 years ago
source link: https://www.tuicool.com/articles/hit/77ZBjmv
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Yes, FreeBSD is faster than Linux. Yet, Linux is faster than FreeBSD. So it depends on what you’re talking about. The TL;DR version is: FreeBSD has lower latency, and Linux has faster application speeds.

Yes, the TCP/IP stack of FreeBSD has far less latency than Linux. That’s why Netflix chooses to stream its movies and shows to you on FreeBSD and never Linux. It’s also why Netflix chooses to pay some of its best engineers to contribute to the current and future codebase of the FreeBSD kernel and not the Linux kernel. In general, many web applications feel “faster” on FreeBSD servers due to the better “response time” or latency.

But nearly all applications run faster on Linux than FreeBSD. IBM and Intel are the two largest benefactors to the Linux kernel, and they are very application (not networking) focused. Virtually every supercomputer runs on Linux for this very reason. If you are using *nix as a workstation rather than Windows or Mac, nearly everything you could run, except perhaps games , runs faster on Linux than FreeBSD.

These two statements ( FreeBSD has lower latency; Linux has more raw power) have been true for two decades now. But they may change just a bit soon! There are some “BSD-inspired” networking improvements to Linux starting with the 4.16 kernel. Facebook has in fact employed engineers for the sole purpose of trying to get Linux up to speed with FreeBSD for the web, and some parts of 4.16 are the fruits of their labors.

But unless you’re using Fedora, your servers aren’t gonna taste it soon. Just by bad timing, the new Ubuntu LTS (18.04) due out next week will still use 4.15, which it will support for 5 years. Since CentOS and Debian are even further behind on kernels, you won’t see a lot of “fast Linux” in production until April 2020 when Ubuntu 20.04 LTS comes out.

At any rate, thanks to the support of corporate behemoths like Netflix (for FreeBSD) and Intel (for Linux) both of these operating systems are likely to be around for at least another 40 years, which is how old *BSD is today (original BSD Unix goes back to 1977, Linux to 1991, and Free BSD to 1993). FreeBSD has something like 5,000 or 6,000 developers involved in some way in the project (along with several hundred working on OpenBSD and NetBSD) and Linux has many more than that if counting all the distributions. This is not a zero-sum game, and both will continue to have many users, developers, and unique strengths.

PS, I’m always surprised to see how many Linux people don’t realize it’s generally slower than FreeBSD for web servers or networking, or FreeBSD people who don’t realize Linux has a lot more horsepower for applications. For instance, many FreeBSD fans will note that Steve Jobs and Apple went to FreeBSD as the backbone of OS X (now MacOS) instead of Linux, but that was really because of licensing differences. MacOS would probably be faster today if it has been based on Linux rather than FreeBSD, as TCP/IP and networking is not the bottleneck of typical Mac usage.

PPS, if you want a bunch of benchmarks comparing the two, try sifting through a website called Phoronix. If you find networking or latency benchmarks, FreeBSD is much better . Every time you find new application or encoding or compiler or even PHP benchmarks, Linux is much better.

PPPS, Linux doesn’t need to close the entire TCP/IP gap to be the faster choice for some web applications. If you’re using Laravel or WordPress without sophisticated caching plugins/techniques, that’s a lot of PHP to be processed on the server and Linux does that faster. But languages like Java are compiled , so FreeBSD is usually faster there even without caching. Response time is also the main thing to worry about (and therefore FreeBSD’s faster) if you have mostly flat HTML/CSS files with client-side JavaScript, or if you have a ton of cache usage on your (for example) WordPress site. On the other hand, if you’re using Java or tons of caching, your site is probably plenty fast already without needing to worry about switching from Linux to FreeBSD.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK