Stories
Slash Boxes
Comments

News for nerds, stuff that matters

Slashdot Log In

Log In

Create Account  |  Retrieve Password

FreeBSD 7.0 Bests Linux In SMP Performance

Posted by kdawson on Thu Mar 06, 2008 08:40 AM
from the coulda-been-a-contender dept.
cecom writes "After major improvements in SMP support in FreeBSD 7.0, benchmarks show it performing 15% better than the latest Linux kernels (PDF, see slides 17 to 19) on 8 CPUs under PostgreSQL and MySQL. While a couple of benchmarks are not conclusive evidence, it can be assumed that FreeBSD will once again be a serious performance contender. Some posters on LWN have noted that the level of Linux performance could be related to the Completely Fair Scheduler, which was merged into the 2.6.23 Linux kernel." Update: 03/06 21:32 GMT by KD : An anonymous reader sent in word that Linux kernel developer Nick Piggin reran the benchmark today and came to a different conclusion: In his benchmark Linux was faster than FreeBSD.
+ -
story

Related Stories

This discussion has been archived. No new comments can be posted.
The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More
Loading... please wait.
  • Well (Score:5, Interesting)

    by morgan_greywolf (835522) <morgan_greywolf@ ... m ['rr.' in gap]> on Thursday March 06 2008, @08:44AM (#22662176) Homepage Journal
    I'd be interested to see results from pre-CFS kernels.

    Not that FreeBSD hasn't made major performance improvements.

    Also, I think that a database test isn't a complete picture. For example, some OSes like IRIX or Mac OS X perform very well on streaming of local video and audio, but I wouldn't benchmark Oracle or PostgreSQL on either.
    • Re:Well (Score:4, Interesting)

      by archen (447353) on Thursday March 06 2008, @08:57AM (#22662298)
      And I like the article summary stating that FreeBSD may now be considered "a serious performance contender". Like FreeBSD was 1000% slower than Linux? Most servers spend their time spinning their wheels anyway, generally I'd rather look at security, how it handles under load and other metrics than whatever "performance" is considered in this instance. Linux is good for some things, BSD for others.

      About the only really good news here is that MySQL performance is actually adequate. As MySQL has always been a dog (usable, but a dog) on FreeBSD, the general rule of thumb was that if you needed MySQL you should stick to Linux; all other factors being equal. So now at least we can get down to other factors that are important instead of one database that performs poorly on one system.
    • Re:Well (Score:5, Informative)

      by Zpin (921535) on Thursday March 06 2008, @09:28AM (#22662598)
      The linked PDF contains pre-CFS kernel benchmarks. Conclusion:

      The new CFS scheduler in 2.6.23 is "Completely Fair" ...to FreeBSD
    • Re: (Score:3, Insightful)

      by saleenS281 (859657)
      You also wouldn't run Oracle or PostgreSQL on them unless you wanted to lose your job. The test is a great test for linux vs. freebds, because it's the type of environment where they'd compete.
    • by mcrbids (148650) on Thursday March 06 2008, @11:38AM (#22664120) Journal
      Yes, I meant that: who cares?

      Nobody living outside their parents' basement is going switch from Linux to BSD for a 15% performance increase. Somebody already using BSD might upgrade if the latest BSD kernels and environment are significantly better than past environments, but 15% is so slight as to be basically undetectable in a real-world environment!

      My rule of thumb for upgrading equipment has been to not bother until we hit a full order of magnitude improvement. In other words, if 1) we can 10X the performance of a system AND 2) there have been complaints about performance, then the upgrade is probably worth it. Even then, the value is dubious. For example, in Postgres, (or any other database application) it's very typical to see 100x improvement simply by creating an index!

      Maybe this is good for frail BSD egos, who have been long bruised by the mindshare success of Linux over the more historic and "more free" BSD. So be it. But it's not performance that's kept me from using BSD, it's familiarity and the pain of switching. And that's also what kept me running it yesterday, will today, and tomorrow too.

      Don't get me wrong - I would hate to see BSD "die" in any meaningful way. The different cultures between Linux and BSD create a very rich, diverse environment where ideas can be tested, and the cross-feed of proven concepts and technologies (EG: Open SSH) benefits all involved!

      But the benefit of a 15% performance increase is almost never going to be sufficient reason to pick one computing technology over another!
      • by Pharmboy (216950) on Thursday March 06 2008, @12:18PM (#22664684) Journal
        But the benefit of a 15% performance increase is almost never going to be sufficient reason to pick one computing technology over another!

        So if you are google, and your software will all 100% run with Linux or BSD, you don't see the idea that 15% better performance means the same work with 15% less machines means something? In certain cases, 15% can mean thousands or millions of dollars, all for changing to an operating system that will basically run on the exact same hardware and run the exact same software, after a recompile.

        No for most it isn't a big deal and may not make people CHANGE operating systems on existing hardware. We use both Linux and BSD, so it *might* make me consider BSD instead of Linux on the next new box. I'm likely not alone in this.
        • by mcrbids (148650) on Thursday March 06 2008, @01:31PM (#22665784) Journal
          Compare 15% against Moore's law, and you find that it equates to a few weeks delay in the price-performance curve.

          If it takes more than a few weeks to make the switch, you've already lost your benefit, as well as the potential of destabilizing your administration of those systems. Backups have be revisited, since the file tree will have changed. Network monitors will have to be updated, and tested for compatibility changes. Little one-off scripts to solve problem X or Y in a hurry will break. Admins will have to be trained, and will make more mistakes for a while until they find out what not to do. Unforeseen wrinkles will inevitably appear, Etc... Etc... Etc...

          Worth it for Google? Not a chance!
      • Re:From TFA... (Score:4, Informative)

        by LizardKing (5245) on Thursday March 06 2008, @11:37AM (#22664100) Homepage

        The article also describes a FreeBSD 7.0 pre-release from October last year. This still had debugging code turned on in the builds, as mentioned on the NetBSD lists when Andrew Doran was comparing NetBSD -current SMP performance.

  • by n3tcat (664243) on Thursday March 06 2008, @08:48AM (#22662208) Homepage
    Maybe now we can finally declare year of the linux desktop!

    Wait, what?
    • BSD Desktops (Score:3, Interesting)

      by parvenu74 (310712)
      Speaking of which: are there any "distros" out there ship a combination of FreeBSD and the latest Gnome desktop? I think that would be a better combination than Ubuntu's Debian+Gnome combo, personally.
      • Re: (Score:3, Interesting)

        by BitZtream (692029)
        Yes, the only FreeBSD 'distro'. FreeBSD is not fragmented like the 100 and 1 Linux distros

        Download the FBSD isos, install the gnome packages. Not new enough, build from source using ports. While it probably doesn't include the absolutely latest Gnome, the FreeBSD people tend to appreciate stability over cutting edge features, so its probably going to be a little behind the bleeding edge, for something popular like gnome though, it should match up with the latest stable release within a very short period
        • Re:BSD Desktops (Score:4, Informative)

          by ninjaz (1202) on Thursday March 06 2008, @09:28AM (#22662596)

          Yes, the only FreeBSD 'distro'. FreeBSD is not fragmented like the 100 and 1 Linux distros

          There are FreeBSD-based PC-BSD [pcbsd.org] and DesktopBSD [desktopbsd.net] Both of them are using KDE, though.

        • Re:BSD Desktops (Score:5, Insightful)

          by Anonymous Coward on Thursday March 06 2008, @09:28AM (#22662604)

          FreeBSD is not fragmented like the 100 and 1 Linux distros

          I'm a FreeBSD fan, but what kind of logic is that? You pick one example out of a fragmented set, and compare it to an entire other set of operating systems.

          You act as if NetBSD, OpenBSD, DragonflyBSD, Darwin, etc, do not exist. Of course and item cannot be fragmented if if you define it's containing set as "itself". Makes about as much sense as:

          Ubuntu is not fragmented like the 100 and 1 BSD distros
          • Re: (Score:3, Insightful)

            by BitZtream (692029)
            Of those you listed, Only DragonflyBSD and Darwin use a FreeBSD kernel, Darwin considerably modified, to the point that it might as well be counted on its own. You can not drop the FreeBSD kernel in any of them and have things work, except for Dragonfly, but even then it still requires (minor) modification.

            Compare/Contrast to Linux distributions. The kernel, assuming version matchs, is rather interchangable between the distros. Its the file system layout, the utilities included, and default configuration
      • Re:BSD Desktops (Score:4, Informative)

        by Ed Avis (5917) <ed@membled.com> on Thursday March 06 2008, @09:39AM (#22662746) Homepage
        You could try Debian GNU/kFreeBSD, though this is not really a distribution of the full FreeBSD system but just its kernel with a GNU userland.
  • Possibly (Score:3, Funny)

    by Malevolent Tester (1201209) * on Thursday March 06 2008, @08:49AM (#22662214) Journal

    While a couple of benchmarks are not conclusive evidence, it can be assumed that FreeBSD will once again be a serious performance contender
    Right up until someone displays a crucifix, that is.
    • Re:Possibly (Score:5, Informative)

      by BitZtream (692029) on Thursday March 06 2008, @09:06AM (#22662394)
      The beastie is not evil! Just because he has horns, a pitchfork and looks like the devil doesn't make him evil!

      You can tell by his smile. It doesn't look freakish or anything ... does it ...
  • by Clover_Kicker (20761) <clover_kicker@yahoo.com> on Thursday March 06 2008, @08:55AM (#22662276)
    to the enlightening and respectful conversation this article will provoke.
  • In short, wow (Score:5, Interesting)

    by MrNemesis (587188) on Thursday March 06 2008, @09:07AM (#22662398) Homepage Journal
    Very, very nice scaling performance under PGSQL is evident in the PDF, and I've no reason to assume the benches aren't legit. I think part fo the reason that PG was traditionally slower than MySQL was that it did lots of complicated locking to provide better scalability across processors, whereas we see MySQL performance dropping off after we go to more than eight cores. I think this was the same philosophy Sun took with "Slowaris", which was also far more scalabe than Linux at the time the moniker was in widespread use.

    Still, I hope Linux can at least match this sort of superb scalability. CFS is fairly new, and I know there's optimisation work been done to it in .24 and .25, although it was a little sad to see the first iteration of CFS performing more poorly than its predecessor (and, if this is the case, I can see why Linus stonewalled CK's patches for so long, since they were mainly tested on desktop workloads). Are there any apples-to-apples comparisons out there that test various flavours and versions of Linux and BSD with a wide range of benchmarks? At the best review sites do a few benches with MySQL, and six months later everything has changed so it's incredibly difficult to do good performance comparisons.

    Even so, it's refreshing to see precious little of the "BSD fudged their benchmarks!" trollspeak in the LKML thread, and plenty of talk about how to make Linux better. Open source is hippy capitalism - it also needs healthy competition to keep it in check :)

    Offtopic: bug linked to in the LKML pointed me at this http://www.latencytop.org/ [latencytop.org] Sounds quite nifty
  • by greg1104 (461138) <gsmith@gregsmith.com> on Thursday March 06 2008, @09:24AM (#22662554) Homepage
    While I'm glad for FreeBSD they're showing good numbers again, their testing of PostgreSQL in this study is rather odd. The results are using the read-only tests from sysbench. You can see from its sourceforge page [sourceforge.net] that sysbench is a MySQL benchmarking tool that has some rudimentary PostgreSQL support bolted on top. That particular code is so bad that the last time I checked, turning on the write OLTP tests deadlocked the PostgreSQL server, as it wasn't putting statements into transactions correctly (which of course the ancient MySQL versions this code targeted doesn't care about). As the sysbench tool hasn't been actively maintained in ages I doubt that has improved.

    The claimed "15% faster than linux" is pretty clear in the MySQL tests; the PostgreSQL ones have a weird dip in them but are in general much closer. I'd be comfortable if the result of this study was "FreeBSD 7 has been optimized to be 15% faster running MySQL than Linux", because that matches what they did (note the specific libpthread patch for example). But the fact that they used such an awful PostgreSQL benchmarking methodology leaves me hesitant to draw a broader conclusion than that based on their tests.
    • While I'm glad for FreeBSD they're showing good numbers again, their testing of PostgreSQL in this study is rather odd.

      Agreed, on both points. What I want to know though, is where this performance improvement, and 7.0 in general, leaves Dragonfly BSD... do they still feel that Dragonfly's choice to split off at 4x and start making radical changes is paying off? Is dragonfly making progress towards better performance, in general, or on particular workloads?

      I saw what Matt Dillon did back in Amiga days. I

      • Re: (Score:3, Informative)

        by renoX (11677)
        The dev of Dragonfly BSD has switched its aim from being 'a better way to do SMP' to 'SSI clustering' so I doubt that Dragonfly BSD is going to compete with FreeBSD in SMP scalability anytime soon if ever.
  • Linux ups the bar (Score:4, Informative)

    by argggh (1251840) on Thursday March 06 2008, @09:37AM (#22662722)
  • by chrysalis (50680) on Thursday March 06 2008, @10:02AM (#22662958) Homepage
    Cool, however it would be better if software working on Linux were also working on FreeBSD.

    boehm-gc is totally broken when using threads on FreeBSD SMP. And it's still totally broken on FreeBSD 7.

    The Neko virtual machine is in ports, but it's unuseable due to this, I don't even understand why it's in the ports tree. Was it ever tested before being imported?

    Just creating a thread:

    $loader.loadprim("std@thread_create", 2)(function(z) { $print(z) }, "OK");

    makes is crash with a corrupted stack. It works on every other operating system. It seems to work on an UP FreeBSD system, but on a FreeBSD 7 SMP system, it crashes, crashes, crashes.
  • by kkenn (83190) on Thursday March 06 2008, @10:11AM (#22663042)
    Hi, I am the one who performed these benchmarks and I'd like to clarify a couple of things:

    * The point of this benchmark is not to unilaterally declare victory over Linux, but to point out that FreeBSD is once again competitive with it on modern high-end hardware and certain workloads. Of course, we are working on other workloads too, and currently perform better than Linux on other benchmarks, and still worse on others. There will no doubt be further friendly competition between the two OSes that will work to the benefit of both. Our message to the Linux developers is that they should not expect to get away with resting on their laurels :-)

    * I benchmarked both mysql and postgresql, and FreeBSD 7.0 performs better than all Linux kernels (at least up to 2.6.23) with both databases. Incidentally postgresql is much faster than mysql, contradicting common wisdom. Other fun facts are that mysql 5.0.51 has poorer scaling than 5.0.47, and 5.1.x has *much* worse performance and scaling than 5.0.47 on my tests.

    * I benchmarked several versions of Linux including 2.6.20.x, 2.6.22 and 2.6.23. 2.6.20.x has terrible performance http://people.freebsd.org/~kris/scaling/scaling.png [freebsd.org]. This graph is from Feb 2007 and the FreeBSD performance also improved after this point.

    * 2.6.22 (which is pre-CFS) mostly fixed this but still performs worse than FreeBSD http://people.freebsd.org/~kris/scaling/os-mysql.png [freebsd.org]. 2.6.23 included the new scheduler and was a major performance regression. I did not yet retest with 2.6.24, so maybe they have fixed CFS by now.

    * Contrary to some commenter's assertions that this is not a CPU benchmark, this benchmark is *extremely* sensitive to CPU performance and especially scheduling (in fact, as noted in the PDF, I/O performance is not a factor here). The scheduler really matters here, which is why Linux took a big hit when they switched to CFS (similarly, on FreeBSD the 4BSD scheduler performs much worse). Tuning the scheduler is critical to performance on this kind of workload. The other critical aspect is having a highly optimized kernel without concurrency bottlenecks. 2.6.20 fell over on kernel concurrency, and 2.6.23 fell over with the scheduler.

    Hope this helps to clarify things.
  • by Lost+Found (844289) on Thursday March 06 2008, @10:15AM (#22663092)
    Looks like it didn't last for long:

    http://www.kernel.org/pub/linux/kernel/people/npiggin/sysbench/ [kernel.org]
    • Nothing against Linux, but it's hardly an apples to apples comparison.
      Exactly. I mean, who cares about performance on a dying OS? ;)
    • by CastrTroy (595695) on Thursday March 06 2008, @08:49AM (#22662220) Homepage
      It probably has a lot to do with FreeBSD having a much more focused niche. FreeBSD is really tuned primarily for servers. You can use it on your desktop, but that's not really it's main purpose. Linux on the other hand, has really branched out. It has desktop distros, server distros, embedded distros, and probably a couple other areas I haven't thought of.
      • by oscartheduck (866357) on Thursday March 06 2008, @08:59AM (#22662322)
        You think so? I dunno, it seems to me that FreeBSD suits the desktop role really well; I use it for preference. Especially when you consider that the only OS with more packages is Debian, it makes sense that it can fit a desktop role extremely nicely.
        • by CastrTroy (595695) on Thursday March 06 2008, @09:08AM (#22662420) Homepage
          How many of those packages are desktop packages? Seems like a odd metric to just compare the number of packages as to how well an OS is suited to the desktop.
          • by oscartheduck (866357) on Thursday March 06 2008, @09:19AM (#22662502)
            Well, I don't think I've ever installed any package from anything other than the ports system. Lots? I know I've installed everything from Gnome, XFCE and KDE, through OpenOffice and a bunch of stuff in between.

            You're right that mere numbers of packages is a weird metric, but what else can we offer? FreeBSD has great performance, and has everything necessary to be either a good server *or* a good desktop. It's much like Gentoo that way -- it doesn't focus on being either one or the other, it focuses on being a solid basis. What you put on top of that basis is your choice. It honestly seems to me that the distinction between server OS and desktop OS is its own entire discussion; if we can come to a good notion of what either means, we can reach a nice conclusion. If we take the current crop of Linux desktop OSes, though, I don't see any more integration between, say, Fedora and Gnome and FreeBSD and Gnome, or Ubuntu and Gnome and FreeBSD and Gnome.

            If I think about it, it does seem that Ubuntu starting with a GUI interface and letting you find the command line by yourself is more friendly to the average user; I haven't installed FreeBSD using anything other than minimal-install for so long that I don't know whether you can have a GUI start up by default. And FreeBSD's installer, whilst excellent for its audience, is less friendly to a first timer. If we take those metrics, the idea of "can I sit down and first time use it without documentation?" then a lot of the linux crop are friendlier, yeah. But the documentation *is* very hand-holdy, and very very thorough for FreeBSD. And nicely available online.
        • by Klaus_1250 (987230) on Thursday March 06 2008, @09:39AM (#22662748)

          I dunno, it seems to me that FreeBSD suits the desktop role really well

          It does (I use it too) BUT only in specific environments. FreeBSD hardware support is not bad, but it is nowhere near as complete as that found in the various Linux distro's. My wireless keyboard + mouse is supported under any recent Linux distro, on FreeBSD, only the keyboard works (fixable with a unofficial ums.ko though). No support under FreeBSD for my DVB-C PCI card either.

          • by peterpi (585134) on Thursday March 06 2008, @10:25AM (#22663244)
            I would say that packages != programs.

            With a debian "package", I know exactly how to install it (the same way as all the others), and I know that there is a set version of that package that corresponds to, say, "Debian Sarge". I know that if I install it, it will pull along any libraries it needs, and that it won't break anything already on my system. I know it doesn't always work like that, but that's the idea. I think of a "package" as part of the distribution. Somebody has decided that it forms part of the distribution, and has hopefully tested it as such.

            A "program" is what Windows has so many of. But all bets are off when it comes to versioning, library dependencies, etc. Even how to install it. If you think of Windows as a "distribution", then it doesn't come with all that many packages at all. A Desktop environment, a browser, some photo and media tools. Mac OS X doesn't really fare all that much better. I love OS X to bits, but the first thing I did was install a third party program (firefox).
          • Re: (Score:3, Funny)

            by AJWM (19027)
            only OS with more packages is Debian
            Whatever happened to Windows?


            Vista. That's a non-operating system.
    • Kreskin sez (Score:5, Funny)

      by eclectro (227083) on Thursday March 06 2008, @09:12AM (#22662454)
      Linux is actually better than BSD because you can roast marshmallows over the schedular flamewars.
    • Re: (Score:3, Interesting)

      Does this apply to single processor machines with dual cores or just multiple processors?

      Interesting point, but from the OS kernel's point-of-view a single-processor, dual-core machine looks exactly like a machine with two processors. So it runs the same code to support SMP whether we're talking single-processor dual-core or multiple processors.

      IOW, if there is a performance difference, I would expect it to show up exactly the same in both FreeBSD and Linux (as well as any other OS that supports SMP).

        • Re: (Score:3, Interesting)

          by Fweeky (41046)
          Yes; Jeff Roberson, the author of FreeBSD's new ULE scheduler, wrote a bit about it [livejournal.com] on his blog a couple of months ago.
        • Re: (Score:3, Informative)

          by TeknoHog (164938)

          Don't dual core CPUs share components (cache maybe?) that an aware OS can exploit for performance improvements?

          The same way an HT CPU shows up as 2 CPUs (with disasterous effects) unless the OS is away and can properly exploit it?

          Some dual cores share L2/3 cache, but not all. Another important factors are the shared connections to external world, such as memory. So I presume inter-CPU communication is faster, but external communication can be slower.

          That aside, HT is a hack which should not be compared to dual core systems at all. In fact, "dual core processor" is a rather silly marketing term, because it means "two processors on one piece of silicon". In other words, you could interpret the phrase "dual-core CPU" as "a CPU th

          • Re:Dual Core (Score:4, Interesting)

            by Wdomburg (141264) on Thursday March 06 2008, @10:25AM (#22663240)
            Have you ever looked at a block diagram of the predominant dual core designs? They're not simply "two processors on one piece of silicon". Both Intel and AMD used a shared cache design with a single connection to the system bus (FSB and HT, respectively). In the case of AMD, it also means a shared memory controller. It's a real difference with real performance and power implications, not a "silly marketing term".

            Now if you complained about Intel shoving two dies into a multi-chip package and calling that quad-core, I'd agree with you. All the reduced bandwidth of a shared connection to the FSB with none of shared cache! Sign me up!
    • Re:finally (Score:4, Funny)

      by BitZtream (692029) on Thursday March 06 2008, @08:55AM (#22662280)
      Your comment would have been funny if we were talking about NetBSD. NetBSD is the one that runs on everything, including a toaster.
      • Re:finally (Score:5, Funny)

        by UbuntuLinux (1242150) on Thursday March 06 2008, @09:04AM (#22662376)
        Hello. I don't believe you know me, but you might be able to help. I use Ubuntu Linux, and I am helping the daughter of a friend to install Linux onto her PC this evening. I have never really spoken to a girl before, and was thinking that maybe if I made a joke, it might break the ice. You are obviously excellent at humour, and I was wondering if you could give me some tips? For instance, it is inevitable that something will go wrong during the process, and I was thinking that maybe if I said something like 'this is almost as unreliable as my beard trimmers!' then it would demonstrate that I am a funny guy. Can you offer any kind of critique of this line, or offer any other advice?
    • by BitZtream (692029) on Thursday March 06 2008, @09:04AM (#22662370)
      Benchmarks are almost but not completely useless. In this particular setup, FBSD 7.0 runs postgres doing some specific set of queries faster than Linux.

      Its a safe bet Linux will do some other set of things faster than FreeBSD does them, possibly even another specific set of PostgreSQL queries for that matter. Linux is definately more concerned with desktop app performance. I can say this safely because Linux actually cares about it, FreeBSD does not. Its there to serve, not run X. It will run X, and if they see a way to make performance better for the desktop apps AND the server apps, then it may go in the source tree. If its going to hurt the server side, don't bet on it.

      While I use FreeBSD for my servers because its got a clean filesystem layout and is designed to be a server OS, I'd be willing to bet that someone with deep knowledge of PostgreSQL on Linux could give it a run for its money by tweaking the kernel for server performance.
    • by Azarael (896715) on Thursday March 06 2008, @09:52AM (#22662880) Homepage
      The article is probably misleading (surprise, surprise), as the tuning documentation for PostgreSQL *states* that good IO performance has more of an impact than good CPU performance. Additionally, some other information I've read (search for postgres tuning/optimi(z|s)ation online) recommends FreeBSD because of its strong IO performance. I'll go out on a limb and assume that MySQL's performance attributes are similar.

      In my opinion, the article summary is a pretty big red herring because the SMP performance may not have a huge impact on the result.
    • by atomic-penguin (100835) <wolfe21.marshall@edu> on Thursday March 06 2008, @09:54AM (#22662896) Homepage Journal
      For one, CFQ is not supposed to be an optimized I/O scheduler for database loads. That's where the Deadline scheduler comes in. You wouldn't want a "Fair" scheduler on your database server, as you would end up putting the database in I/O wait to handle lower priority processes.