Geek alert! This article is for Slicehost geeks only.
Talk about playing on the edge, I almost fell off this time. I have eight slices (virtual servers, that is) on Slicehost (which is now owned by Rackspace) and believe me they are tiny![1] But they can serve low-volume to medium-volume web sites pretty well. For instance, Shaping Youth (several thousand visitors a day) and GirlsHorseClub are on these little servers and they serve up pretty rapidly.[2] Nice thing about Slicehost is that any host can be scaled up from the tiny size to 16x that size, and because it’s cloud computing, you can also bring up multiple instances of any server and have them share load. This allows me to implement the traditional three-tiered architecture (web/application/database) quite well without having to worry about whether my servers will be able to handle the load because I can scale ’em up whenever I need to.
But, the catch is that when you start with the tiniest slice (256MB RAM) you really have to fine-tune your operating system and applications in order to get good performance out of them.
This has led me to some fun discoveries about 1) how to make Apache work in a really tight space; 2) how to add additional web serving using NGINX (engine-X); 3) how to run MySQL in less space; and finally 4) how to use Java and Tomcat wedged into a non-existent memory slice.
Today’s lesson for me was installing Tomcat 5.5 on Slicehost. I started by reading How to Install Tomcat on Ubuntu in the mkyong blog. Not bad at all. The essence is to first find out what version of Tomcat is available on your slice:
sudo apt–cache search tomcat
Then install that version and the admin app for it:
apt–get ––fix–missing install tomcat5.5
apt–get ––fix–missing install tomcat5.5-webapps
apt–get ––fix–missing install tomcat5.5-admin
Then I like to have /usr/local/tomcat defined (like on all my other servers):
ln –s /usr/share/tomcat5.5/server/ /usr/local/tomcat
That was about all it took. It serves by default on port 8180 – and the admin app was there and ready to go. My next step was to port a Java app that I have been running on bigger servers over to this little server. That actually worked quite well, requiring about 6 hours to port, recompile (to eliminate a few warnings) and test.
[1] Six of them are 256MB (RAM) and two are 512MB.
[2] These two slices actually had to be boosted to 512MB recently in order to handle anticipated high traffic. But I can reduce their size after the stress-out period passes.
Leave a Reply