Live data from Hacker News

Ask HN: What Linux distro for a Rails app that needs to scale?

news.ycombinator.com

21–27 of 27 posts

Re: Ask HN: What Linux distro for a Rails app that needs to scale?

#22
post #3

Debian. It's what Ubuntu is based on, but it's less crufty. I use Debian for everything I do, and I've never had a problem. Take my advice with a grain of salt however, as I've never really had to scale anything. One other thing, make sure you build everything from the source. Get exactly what you want/need, and nothing more as well as the latest packages.

One other thing, make sure you build everything from the source.

I was right there with you until this bit of crazy.

Do not build everything from source. You're just asking for trouble when you do. You lose so many really important features of modern Linux distros when you do this, that I can't believe people are still suggesting it as a sane practice for production servers.

If you install from source you won't be able to update quickly and easily via apt-get or yum when a security update comes out...you'll have to rebuild. But, you probably won't even know a security update exists until it's too late. If you don't keep copious and specific notes about what your custom build does, and why you did it that way, you will forget a flag or overwrite or lose a config file, and it will break something next time you roll out a new version.

The performance benefits are probably negligible, and in my many years experience cleaning up amateur maintained systems, it is just as likely to be negative as it is positive. You probably know dramatically less about the package you're building than the maintainer of the OS package, and you're more likely to make mistakes than they are. Those mistakes could have security implications, performance implications, or stability implications.

Certainly, if you are the maintainer of some piece of software, you might want to replace it. I've never run a system without at least a few custom builds...but the custom pieces are usually software that I am one of the core maintainers of, and I know it better than just about anybody. And, when I do run custom software, I tend to build an RPM or deb of it, and setup a local yum or apt-get repo, so that when I need to replicate my production machine, I can do it quickly and consistently.

Re: Ask HN: What Linux distro for a Rails app that needs to scale?

#23
post #14

The Linux distribution isn't the big bottleneck, but yes, I'd probably go with the 64-bit Ubuntu Server. I think Engine Yard, which is where I'm hosting right now, uses Gentoo, it seems to work fine.

If you're scaling horizontally, is 64 bit a win? It eats up memory in Ruby processes. We switched our app (which does not need to scale; it's shrinkwrap) to 32 bit Ubuntu and that was a win for us. (Gentoo? Blech. -funroll-loops.)

Depends on the app I guess, we do a lot of large number computations that surpass the 32-bit limit, so I think for our specific case a 64-bit distro is much better.

Re: Ask HN: What Linux distro for a Rails app that needs to scale?

#24
More than the actual distro I'd say look into what kernel you are loading on there. Make sure you're running a nice tight kernel with any extra fluff turned off (or loading as modules).

I can't find the papers off hand but there has been some research into how kernel level cache tweaks will dramatically effect how web servers and DB servers will perform.

Re: Ask HN: What Linux distro for a Rails app that needs to scale?

#26
good q. if you can, use the same thing on the server as you use on your desktop. i use 32 bit ubuntu (8.04). if it performs fine on your 2GB RAM thinkpad, it will probably do fine on an ec2 box, no? if the config works on my desktop, it will work on the server, etc. tremendous advantage in terms of sysadmin requirements in my book. your mileage may vary depending on how much you like os x :>)

Re: Ask HN: What Linux distro for a Rails app that needs to scale?

#27
Time is probably your most important resource here. Shaving a few nanoseconds off a query because you compiled your kernel with one different option won't do you much good, whereas an easy to administer OS with readily available binaries will save you a lot of time and headache.

I'd say 64-bit Debian. I have already mentioned my qualms with Ubuntu elsewhere on HN (I don't like upgrading every 6 months, and I don't want to be stuck with old software in case I decide to skip an upgrade).

Post reply on HN