« Damian Conway in Boston this Coming Monday | Main | Guide to Incompatibilities when Upgrading MySQL to Version 4.1 »
September 28, 2006
Bare Bones OS for MySQL?
While laying in bed last night thinking about getting started on a project that requires getting a fresh MySQL clustered database up and running I got to thinking. What is the best OS for MySQL from a minimalistic point of view? If you're starting from scratch to set up a server, or farm of servers, to run MySQL and can choose any OS, what do you choose?
I'm going to venture that it's a Unix variant, perhaps a flavor of Linux? There's a lot to think about in terms of what types of data and how the application will use the database, but from a general point of view where would one start? Let's suppose that the hardware is your typical generic AMD/Intel with high-end SCSI disks.
I'm thinking about things like:
- minimal OS footprint (only necessary applications/libraries)
- minimal OS processes
- a kernel optimized for MySQL-specific functions, minized for everything else
My experience running MySQL is on Solaris, Red Hat/Fedora Core Linux, Gentoo Linux, and Mac OS X. I'd guess that RedHat/Fedora will automatically get thrown out because they are built for the masses and while you can install minimally, the kernel is built to support everything under the sun. If I'm running on generic AMD/Intel hardward OS X isn't an option and I'm inclined to rule out Solaris.
That leaves me with Gentoo, or considering something I haven't used before. Perhaps FreeBSD? The popular Linux flavors these days seem to be Ubuntu and CentOS. Have little experience with either, but it doesn't seem like the buzz on the street about either is centered on performance or minimalism.
Now that I've actually thrown this all down into sentences I wonder if it's even worth the trouble of finding and paring down an OS to find the most optimal footprint? The tradeoff is that I'll be in new territory, introduce any number of uncertainties, and in the end wish I would have stuck with something I know or that is well-used.
But it's always good to be thinking about this. Someday (unless I missed it) there will be a MySQL-optimized Linux/Unix installation that has everything you need, but nothing more. I wonder what Pogo Linux was doing for the MySQL appliance they were shipping a few years back (don't see any information about the appliance on their site now). Looks like the Pogo systems ship with either Red Hat, Fedora or SuSE. Perhaps they didn't do anything special, but the press releases seem to indicate the system was tuned for maximum performance.
I'll have to spend some time diging around Peter's blog to see what information is there. I'm pretty sure there was a presentation in one of the recent conferences comparing Linux distributions for MySQL performance.
Posted by mike at September 28, 2006 8:43 AM
Comments
I'd use Core Linux, or perhaps Slackware.
http://coredistro.sourceforge.net/
http://www.slackware.com/
FreeBSD would be the best option of those you mentioned, but that's if you want to run BSD instead of linux.
I would not consider Gentoo, CentOS, or Ubuntu to be 'minimalist' distros, nor would I want to use them for clustering.
Posted by: Sean at September 28, 2006 1:59 PM
We use Gentoo at my employer. I use Ubuntu on some desktop systems and if you're buying a high-end AMD/Intel processor, I have to say there seems to be a real difference between a kernel and libraries compiled for the specific processor, and one compiled for i386. In some applications I can really notice a difference (I ripped Gentoo off a desktop box and put Ubuntu on it, and GUI applications are noticeably slower, for one thing).
So I'd hate to put a generic i386 kernel on that expensive hardware.
Posted by: Xaprb at September 28, 2006 3:59 PM
Re: Linux vs *BSD vs Solaris, this article http://software.newsforge.com/article.pl?sid=04/12/27/1243207&tid=72 shows MySQL benchmarks between these. Linux does consistently better, usually a *lot* better.
Re: optimizing for MySQL, this presentation/article http://dev.mysql.com/tech-resources/presentations/presentation-oscon2000-20000719/index.html has a pretty good list. Would be nice to have a more detailed list, such as optimal Linux kernel settings.
Posted by: Pete Kruckenberg at September 29, 2006 12:23 AM
I have actually had a lot of thoughts about NOT using Gentoo recently myself. I'll probably write something soon on it. Compiling everything from source causes a myriad of problems. None are unsolvable, but I haven't been able to think of a way to do it -- especially for clustered machines -- without some extra work that I just resent having to do.
Posted by: Xaprb at September 29, 2006 9:08 AM
CentOS is Red Hat Enterprise Linux -- it's a rebuild project and with CentOS 4.4 you get a binary compatible free version of Red Hat Enterprise Linux 4 Update 4.
I agree with Xaprb, I would not use Gentoo either. It would take you a week to get Gentoo up and running because you'll be compiling *everything* from scratch. Sure, this will allow you to get the bare minimum install, but it is a lot of work.
It really depends on how *minimal* you want your install to be. I'd suggest something solid like CentOS or FreeBSD for the job. They may not be as minimal as you want, but you can strip a lot of stuff away. Debian may also be a good choice for you.
Posted by: mookie at September 30, 2006 7:02 PM
I use Gentoo for all my applications. Why? It's about as minimal a 'linux distro' can get without loosing too much comfort. I don't understand how you guys can talk about 'weeks of compiling' either, especially in a cluster. Personally i have a 'binhost' which builds packages for all the computers in my cluster (all amd64) and it works extremely well.
For initial Gentoo installs i just did a clone of the partition and threw it on all boxes in the cluster.
And in Linux vs BSD for mysql hosting, BSD (FreeBSD in my case) is unfortunately out of the question - it just didn't perform as Linux does - not anyway near to be blunt.
Don't know if my ranting will change the way you see upon Gentoo - but all the fuzz you mention is something i never stumble on in my daily Linux usage.
Posted by: Johan at October 5, 2006 5:31 AM