Best tiny unix for serving Java servlets?
June 1, 2010 8:46 AM   Subscribe

Recommendations for a tiny Unix distro for serving servlets and nothing else.

I'm building a VMWare Fusion instance that will be dedicated to running a Java servlets-based web app. That's the only thing it'll have to do, so I don't need X, or any of the other things that come with default installs.

What it'll need (ideally easily installed w/a package manager):
-Tomcat (I'm vaguely aware there are differences in javas for Linux -- I'd like the faster one please, and have no ideological issues)
- Apache 2
- MySQL 5
- SSH.

Size and memory footprint -- around 300mb memory and a few gig disk would be a good target -- are my key considerations, but I'd also like to be pretty hardened -- some of the places it'll end up are really set-it-and-forget-it (although most of these will be inside an intranet)

Before I try to roll my own or strip down one of the big installs, has anyone got here before me? I don't mind whether it's Linux, a BSD, OpenSolaris or what-have-you.
posted by bonaldi to Computers & Internet (9 answers total) 1 user marked this as a favorite
 
Sounds like a job for OpenBSD.
posted by Biru at 8:53 AM on June 1, 2010


I have played with a tiny little LAMP-stack distro that totals up to something like 10MB total. Believe it's based on DSL. Looks like you can add the JRE as well.
posted by jquinby at 8:58 AM on June 1, 2010


Rats, it's not DSL - I fired it up and checked, and the one I use is based on Trinux, which seems to have morphed into ubuntutrinux. I would guess that DSL or Puppy Linux are going to be good bets.
posted by jquinby at 9:01 AM on June 1, 2010


I haven't looked, but I wouldn't be surprised if there's an existing VMware Appliance that fits the bill.

Also, have you actually done any memory profiling on the servlets you'll be running? If you're going to do anything that involves maintaining sessions, 300MB virtual RAM might not be enough.
posted by me & my monkey at 9:23 AM on June 1, 2010


I like ArchLinux for these kinds of things. It's a stripped down version of linux were you basically install everything from the package manager. It's not for newbies, but it is a satisfying way to build exactly the kind of Linux you want.
posted by gkhan at 9:29 AM on June 1, 2010


There are lots of distros with installation options that don't include X and a desktop environment. From your description, I'd reach first for Ubuntu server edition. The current release is a long-term support release, which means they'll be offering security updates for the server edition for the next five years. Plain Debian would be fine, too. With either, turn off automatically installing recommended packages before you install your extras. For hardening, check out AppArmor in Ubuntu and SELinux in Debian.

Neither is ultra-minimal; both will leave you with some stuff you didn't need. But to start substantially smaller than them, you'd probably be rolling your own. And Ubuntu or Debian come with security updates and large communities, which is a huge advantage.

I wouldn't recommend Arch for this purpose. Arch values having the latest release of everything over stability, which isn't the trade-off you want for a server (pace Arch fans -- it's a great distro for other situations.)
posted by Zed at 11:00 AM on June 1, 2010


bonaldi: "Size and memory footprint -- around 300mb memory and a few gig disk would be a good target"

My Ubuntu Linux Linode fits within these parameters. I run postgres and apache2 and python, and it fits within the smallest profile they offer, 360MB. Linode did do a lot of precutting though, to strip it down, because half of their nodes are Ubuntu based. Things like removing all the locales, documentation, etc. Most of it is for disk savings rather than RAM, so I wouldn't worry too much about it. It sounds like the main benefit to you is that your customers will be more likely to fix it without your help than if you rolled your own distribution. As a bonus, the latest Ubuntu release is LTS, so you get 5 years support (read: security patches) on server, and dist-upgrade support to the next LTS.

The bigger challenge here is probably going to be JVM heap. Generally, the JVM likes to cache things for performance and your RAM target is very small if you have more than one or two users. So double check that 300MB is feasible for your application. Not to mention, MySQL will also like to cache things, so make sure you tune that somewhere far lower to avoid starving the rest of the stack.
posted by pwnguin at 11:41 AM on June 1, 2010


Response by poster: Very helpful answers, thank you everyone. I think the app runs to about 150mb when it's going, so you're right -- i'll up the amount of space the machine gets to at least 512mb.
posted by bonaldi at 2:39 PM on June 1, 2010


A base install of ubuntu server edition fits the bill.
posted by PueExMachina at 8:36 PM on June 1, 2010


« Older How do I slow down my window shade?   |   Do florists need refrigerated vans? Newer »
This thread is closed to new comments.