xcache

Drupal with Lighttpd and XCache on Debian

After several years of tinkering with my Drupal deployment stack, I've finally found one that I think is both stable and performant. There is usually a trade-off between the two, but not anymore.

Debian Setup

My stack starts with the latest version of Debian Etch. Both Slicehost and RimuHosting provide these as an OS choice for their VPS plans.

Now, some people will only use packages from the stable repositories on Debian. If you're one of those people, you can still follow the majority of this tutorial. However, you will need to skip the part about updating sources.list and you also won't be able to install the php5-xcache package using apt (as of this post its still only available in test). You will still be able to download and build XCache from source, but I won't be going over that here.

From my own experience, I've found that the packages in test are "stable enough". Of the small bugs that do get into test, I haven't ran into them, nor (as of this post) are there any bugs in test that effect the packages we'll be installing here.

So, first thing we'll do is edit our sources.list file to include the testing repository if you haven't already done so.

nano /etc/apt/sources.list

XCache on Lighttpd

A few weeks back I added XCache to my LAMP stack for a little performance boost. I didn't notice any immediate gains even though my phpinfo showed that XCache was installed. After some further digging and a little oversight on my part, I found that you must change xcache.size in your php.ini to anything greater than 0. That setting basically allows XCache the memory it needs to do its job. I tried the default 64M and immediately things seemed to pick up. I also noticed that less resources were being used on my machine after this tweak.

Current stack:

  • Ubuntu Server (Dapper Drake)
  • Lighttpd
  • XCache
  • MySQL 5
  • PHP 5

Seems to be working very nicely.