random memes }

Xen, Java and Web Hosting

This week my current web hosting service sent me a notice that I was approaching the storage limit on the account. At the time I setup the account (a few years back), the $20/month plan offered a pretty good deal. Since then other providors have come along with more generous offerings, but since I wasn't running up against any limits, it was not worth the hassle of making a change.

Now that I am running close to the account storage limit, it is time to take another look. It took me a while to pick the first provider, and I can see that the second time around is not going to be any easier. My initial requirements as near as I can figure:

The above is very easy to find. The second part is a little less certain.

While I would like to have access to a well-run mail server, installing and maintaining my own mail server is a bit too much of a moving target. I don't need another hobby! Admittedly with GMail offering generous limits, and the ability to send and receive through GMail using another address, I am not certain that this is needed anymore. Unfortunately there is a lot of variation in how the providors offer an email service. The first time around - setup a couple of accounts, and cancelled after I had a good look at working with their email service. Most of my current disk usage is for @bannister.us email (522.22 MB).

The above filters the list down somewhat. The next part was simply not available (at modest cost) the first time around.

After considerable mucking about, I have come to the conclusion that I really want to use Java and a full-performance Sun JVM on the server.

PHP - the most commonly available alternative - has a low threshold for entry for new programmers, and the resulting works largely reflect this. Lots of projects get started, generate early/flashy results, then bog down. Look inside and you find the code is a mess. Pretty much what you would expect from new, enthusiastic programmers with limited skills. (Admittedly I wasn't impressed with the internals of the PHP interpreter either). PHP is good for small/simple webapps, but beyond that is less desirable (my opinion).

Java projects tend to have a different malady. The threshold for entry with Java is a bit higher, and requires that you understand abstractions. Perhaps not surprisingly, the quality of Java code tends to be higher, with the common failing of too many abstractions. Occam's Razor: Do not multiply concepts beyond necessity - could be more often applied in the Java world (about which Bruce Tate has written well).

Of course the usual notion applies - a good programmer can produce well-written code in most languages, and a less-skilled programmer can write poor code in any language.

Given the claimed efficiency of the Sun JVM I'd rather host any more dynamic language (Jython, Groovy, JRuby, whatever) under the same throughly-optimized VM.

As an aside - I've long wondered if you could do efficient Java hosting on Unix by pre-loading a single master JVM with a large number of commonly-used Java classes, and calling fork() to clone an instance to process subscriber code. Would shared virtual memory pages and copy-on-write reduce the physical memory usage, and indirectly (through improved caching) reduce CPU usage?

What has changed in the web-hosting world since I last looked is the use of first User Mode Linux and more recently Xen to efficently subdivide a single physical machine into multiple isolated virtual machines. Searching on "Xen", "Java" and "hosting" comes back with quite a list. Most seem(?) to expect me to install and administer my own mail server - which I'd rather not. The per-account memory limits are not especially generous - are they sufficient to run Tomcat or Jetty well?

The refactoring for efficient AJAX support is especially interesting in Jetty 6.

I can see this is going to take some work...

Update 5/1/2006: Moved everything over to DreamHost a few months back. No Java support, but the weblog (PHP) and email are running fine - and I have more disk storage and bandwidth than likely I will ever need.