Live data from Hacker News

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

news.ycombinator.com

11–20 of 27 posts

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

#11
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.

What do you mean less crufty? I think this is just your perceived vision of Debian.

We use Ubuntu 8.04 LTS because it is committed to be supported for a very long time. Traditionally Debian releases have been supported with security updates and the like for one year after the subsequent release. There's no guarantee or date for Debian. Ubuntu 8.04 Server Edition on the other hand is supported through 2013... and that very well might turn out to be longer than Debian 5.0.

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

#12
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.

I would say building from source is a horrible idea if you want to scale. For us we had some sweet custom built from source setups that were fast as hell, but once we started putting more servers online it was a hassle to set each one up identically. Better to go with a standard install and be able to reproduce it easily - because no matter what you efficiency gains by compiling are, if you need a new server you will need a new server.

And if the answer is "visualized it" - then compiling is a waste of your time to being with. Better to run native from packages than virtualized from source.

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

#13
post #6

Gentoo if you have a lot of time to customize everything and don't mind rehacking on the kernel configuration with every release. Ubuntu if you want something that just works and has available commercial support if you need it down the road. Debian if you like Ubuntu but somehow feel that Debian is more "pure". I wouldn't use anything else.

Gentoo is cargo-cult Linux. Tweaking compiler options and use flags rarely produces any measurable benefit, but it guarantees that you're using a unique, untested configuration that may expose bugs other people have never seen.

Been through the horror over here, on Ubuntu now. No measurable difference in speed of the server, but plenty measurable difference in speed of deploying new ones and a major decrease in swearing from the direction of the server room.

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

#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.)

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

#15
post #9

I have no stats in front of me, but I have always been made to understand that BSD's (namely FreeBSD) handle high traffic better than linux. I personally use Debian for everything. I can't imagine the distro making a huge difference really. I've used Debian as a desktop os for some time, so when I needed a server os, it was easy to get going quickly. Switching from Apache to Nginx made more of a difference in my case…

I don't know FreeBSD vs. Linux (and god do I ever not want to see that one hashed out), but let me assure you based on significant commercial experience in performance-critical apps that the other BSDs are not the way to go here.

You're working against the grain if you go BSD instead of Linux with Rails, whether you like FreeBSD or not.

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

#17
It's also worth noting that at least around christmas of last year, it was brought to light that the Ruby 1.8 package in apt-get on ubuntu is TWICE as slow as building 1.8 from source.

make sure you build from source.

http://antoniocangiano.com/2008/12/09/the-great-ruby-shootou...

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

#18
post #6

Gentoo if you have a lot of time to customize everything and don't mind rehacking on the kernel configuration with every release. Ubuntu if you want something that just works and has available commercial support if you need it down the road. Debian if you like Ubuntu but somehow feel that Debian is more "pure". I wouldn't use anything else.

Gentoo is cargo-cult Linux. Tweaking compiler options and use flags rarely produces any measurable benefit, but it guarantees that you're using a unique, untested configuration that may expose bugs other people have never seen.

Cannot upvote this enough. Gentoo is a fools game on servers. If you want to dick around several hours every time you update your system on your desktop machine, have at it. But, if you're inviting that kind of chaos into your life on your production server that provides your livelihood, you deserve no pity (and you're unlikely to get any from anyone who has enough experience to be managing a server).

I have a vested interest in being pretty much OS agnostic; our products support tons of systems and versions, and you can easily get me to say nice things about all sorts of operating systems. But, I simply can't have no opinion about Gentoo. It's just such a poor choice for a server that I'd feel guilty not using the strongest possible language to discourage folks from using it.

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

#19
post #9

I have no stats in front of me, but I have always been made to understand that BSD's (namely FreeBSD) handle high traffic better than linux. I personally use Debian for everything. I can't imagine the distro making a huge difference really. I've used Debian as a desktop os for some time, so when I needed a server os, it was easy to get going quickly. Switching from Apache to Nginx made more of a difference in my case…

but I have always been made to understand that BSD's (namely FreeBSD) handle high traffic better than linux

For the past several years, and up until FreeBSD 7 you've always been seriously misled. FreeBSD has historically had dramatically worse performance in most concurrent server applications (certainly in multi-process SMP workloads). As of FreeBSD 7, it generally is the equal or slight better of Linux. It is not better in enough categories or by a large enough margin for anyone to say with confidence that a particular workload will perform better on FreeBSD or Linux. One would always have to benchmark the actual application, and the differences would be minimal in most cases...and with every new kernel release, you'd have to benchmark again, because things change and performance advantages might flip from one release to the next.

And, tptacek is correct, none of the other BSDs has inherited these dramatic performance improvements found in FreeBSD 7, so they are very unlikely to provide better performance than any modern Linux version on modern multi-core hardware.

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

#20
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.)

We've noticed that several VPS providers are only offering 64-bit OS installs...which makes no sense. I kinda suspect it is simply a way to force people to pay for more memory down the road. The memory usage of dynamic languages (Ruby included) is dramatically higher in 64 bit builds...more than 50% in many cases.

If you don't have more than 4GB of RAM, it makes absolutely no sense to have a 64 bit OS install.

Post reply on HN