0

Individual web servers working together

Posted February 11th, 2010 in Uncategorized by Andrew Gould

Earlier this week I did something we hadn’t done before. Two servers to power the one website. There’s no more redundancy than before – in fact, I’ve added another point of failure to the equation. Why have I done this? I’m greedy. I want my cake and to eat it too.

static.chombo.com.au. It’s a virtual machine running the bare essentials. CentOS 5, lighttpd. No PHP, no MySQL, no Webmin. I’ve even got lighttpd stripped down, running only the modules that it needs. It’s not capable of vhosts or URL rewriting, so no fancy URLs or different content for different hostnames. All it has is the ability to respond to HTTP requests and the ability to compress JavaScript and CSS on the fly. Why have I done that? For speed. What’s it going to be hosting? Images, JavaScript, CSS.

I’ve been told that when you’re on a fast computer and fast network link not far from the server (less than 20ms latency), there can be a slightly noticeable difference in loading times between Apache and lighttpd when serving the same content. For ages we’ve had Apache and lighttpd running on the server that hosts chombo.com.au, lighttpd hosting all the public content, Apache hosting our ‘preview’ website – the place where we can test website revisions before they go public. I do have a problem with lighttpd, however. It’s a pain in the backside if you’re wanting to be running any URL rewriting. Could be my config file causing the problems, but I think it’s just fussy. Time to run Apache for the public content, I think!

My reason for setting up static.chombo.com.au was so that I could have the flexibility of Apache for the main website and still get the fast response times of lighttpd. As I said, static.chombo.com.au is going to be for images/CSS/JavaScript only, meaning Apache will really only do the PHP stuff. Make sense?

Comments are closed.