I really must work on my post titles but how else can you describe it?
Webopius recently had an opportunity to try out a new VPS hosting provider (Slicehost) for a new site we’d recently completed – CotswoldNews. We normally stick to dedicated hosting but the performance of VPS systems has improved significantly over the years and Slicehost give you a ‘raw’ system with full root access to play with at a great price so we had to give it a go.
As Cotswold news was a Drupal based site it was also a chance to see how Drupal performed on a non Apache web server. We’d heard good things about nginx in terms of performance and memory use.
Slicehost
If you’ve ever looked for a hosting company, managed or otherwise, you’ll know there are hundreds out there all proclaiming to be the best. To make it more difficult, for every good customer review, you’ll find 3 others that are negative.
We did a LOT of research into VPS providers and settled on Slicehost because it was very hard (impossible?) to find a really bad review of them. They give you Tier-1 bandwidth, a choice of Linux operating systems, root access, 64 bit virtual slices, RAID-10 drives and capped machines so you are not sharing with hundreds of others.
After registration, we chose an Ubuntu Hardy distribution and within 2 minutes we received the machines IP address and login details.
You really do get a raw Linux install, so the next steps were to add users, manage security, install all the core applications and development tools.
NGINX
Next step was the nginx install which at the basic level was a one line command. Easy. Not so easy was configuring PHP5 to run with fastcgi so that it would work with Drupal. If anyone wants a copy of our nginx configuration file and the method we used, just comment below.
Why nginx?
We chose nginx instead of Apache because we were looking for a lightweight, high performance web server with a minimal memory footprint. nginx is apparently the fourth most popular web server and it’s very fast and scaleable. As indicated above, the only downside was lack of support for fastcgi spawning.
Drupal
Once we’d got nginx and php working the rest was simple. Standard Drupal install with a mysql database. Install of phpmyadmin and configuration of the nginx files to support Drupal redirect rules.
Slicehost DNS
Finally, we used the slicehost slice manager to create DNS records and an hour later after DNS propagation the site was up and running.
Initial impressions are that it is FAST and the site is working well even though it has some pretty complex sets of SQL queries to render the pages. You do need a strong Unix background to get the VPS set up but as Slicehost say themselves, it is geared towards developers. Very impressive though.
We will keep monitoring and report back in a month or so.
* Note: Webopius has no affiliation with Slicehost, nginx or Drupal – we just like them.




















[...] may have seen on our previous post that we are running one of our sites on a Linux Ubuntu server with the nginx web [...]
hi. i am also a happy slicehost camper. also serving drupal through nginx. i am curious how you have your fastcgi. i have a setup that works, but as i add modules to my drupal install, i am seeing a drop in performance and i’m wondering if there might be a better way or if my config needs tweaking.
i am using a binary called php-fastcgi that is included in the lighttpd package (which i am otherwise not using). i found a little initscript to run php-fastcgi which seems to spawn 5 php-cgi processes.
how did you guys set it up?
Hi Paul,
We also use the same lightspeed based script. We followed the instructions on this site to get it working:
http://blog.elderec.com/2008/07/16/ubuntu-hardy-nginx-php5-fastcgi/
Here’s the script that spawns the processes to listen on port 9000:
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 9000 -u www-data -g www-data -C 2 -f /usr/bin/php5-cgi
The -C param specifies the number of processes which as you can see for us is 2.
In addition to the usual modules, on our Drupal site we are running CCK, search, taxonomy, image, image assist, pathauto, lightbox2, global redirect, wysiwyg, views and a couple of custom modules we wrote for News articles and Google news support.
At the moment, all is working well however, some people say it might be better to use Apache as the PHP handler for nginx.
For example: http://www.megaburst.com/load-balancing/wordpress-benchmarks-running-on-nginx-php-apache-and-fastcgi/
Although I suspect the caching had a lot to do with the good Apache performance in this case.
[...] and nginx work well together (see the previous VPS, Drupal, nginx post here) but you might discover that a few modules cause problems because of .htaccess or redirects written [...]
[...] If the references to ‘fastcgi’ mean nothing, take a look at the comments section of this posting about nginx and the lighttpd fastcgi script: [...]
Warning: http://blog.elderec.com/2008/07/16/ubuntu-hardy-nginx-php5-fastcgi/ doesn’t work anymore and it’s now a spam-web.