Drupal + RackspaceCloud + Ubuntu + ISPConfig + Nginx (DRUIN) vs. Shared Hosting

Drupal + RackspaceCloud + Ubuntu + ISPConfig + Nginx (DRUIN) vs. Shared Hosting

I host a number of low traffic Drupal (drupal.org) websites.  Several for a non-profit, a few consulting shops, a book & poetry site.  Low traffic, but a couple sites use lots of drupal modules, so performance and resource limits can sometimes be issues.

I've used hotdrupal.com as my hosting service for some years.  They've really been excellent.  First rate.  I've only needed support a few times and they've always been prompt and professional.  But the big thing, for me, is the accounts are highly optimized for drupal.  My webpages load in less than 200 ms (thats a Drupal Devel module timing number).  I've toyed with other hosts but nothing comes close.  Part of it the large php memory_limit = 160M in the stock php.ini for my account.  Nice.  But they've obviously got other optimizations too.

Still, nothing lasts forever.  As Drupal grows, and as my websites grow, I've used more and more resources.  Currently I'm bumping into my account's 3GB disk space limit.  And that includes the MySQL databases.  One of those is using > 400 MB.  That's as reported by Cpanel, which is the number that counts toward my allowed quotas.  phpMyAdmin reports less than half that number, but I gather this discrepancy is fairly common.

Now, hotdrupal.com isn't all that generous on disk space.  They say they provide premium disk space (meaning fast), so they can't provide unlimited amounts of space.  I'd just get more diskspace, but for the incremental cost I could price myself into another provider. 

It's a business plan dilemma, I think.  Host companies price their plans based on making money with technology available today.  But user needs, naturally, grow with time.  No avoiding that.  My cycle seems to be every 3 years I come close to outgrowing my host provider, and I'm about at that point now.  And as technology moves forward, I thought I may as well look into modern cloud hosting as wel.

So, hotdrupal.com is my baseline.  I've decided to look at hostgator.com, which seems to be one of the better large shared hosting houses.  I picked hostgator.com to test because their stock php.ini has an amazing memory_limit = 256MB.  I've not seen any shared hosting that can touch that.

But the real plunge is with rackspacecloud.  I hear nothing but good things about them, and a 256M RAM image with 10 GB disk space is only $11/month.  Plus all that near-instant scalability, if needed.  I've used VSPs before and they have lots of pluses for Drupal hosting, but I'm still not sure I want to be a sysadmin.  Shared hosting with cpanel is really much easier, by comparison.

But OK, if I'm to take the VPS/Cloud plunge, lets just see what this thing can do.

  • Rack Space Cloud Server 256M RAM, 10G disk (cheap: $11/month)
  • Ubuntu 10.4 LTS (solid, Debian based)
  • ISPconfig 3 control panel (new to me, but good support for Nginx)
  • Nginx webserver
  • PHP-FPM
  • MySQL

I can do the command line file edit config thing, but I'd rather have a nice control panel to easily add new websites and such.  I like Webmin/Virtualmin but it doesn't really handle Nginx properly yet.  ISPconfig 3 seems OK, but I'm still learning it's idiosyncrasies and it's definitely not as rich as Webmin/Virtualmin.  Looks OK though.

To install this stuff, I followed this outline from howtoforge.com:

http://www.howtoforge.com/perfect-server-ubuntu-11.10-with-nginx-ispcon…

You can't cook like this by mechanically reading recipes.  Versions are constantly changing and you rarely want exactly what someone's article is implementing.  But I've found the howtoforge.com outlines pretty consistently good.  I followed this one, but I left out most of the mail stuff and DNS, which I don't really need.  Mostly the install went pretty smoothly.

Mostly it's stock parts, and the site mostly worked without many tweeks.  phpMyAdmin worked.  Using ISPconfig I set up a virtual site, intended to be home for my Drupal multisite setup (which I pulled, codebase, /sites, databases and all, verbatim from my hotdrupal.com account.)  I edited the /sites/xxx.com/settings.php file to get the right username:password for my new rackspace database and hey, preso!  The webiste lives!

OOTB, clean URLs didn't work.  I could edit the vhost file for Nginx, but that would get re-written by any edits done via ISPconfig.  Better, go to Options tab for the website in ISPconfig and add the drupal - unique directives there.  The ones I'm using currently I got from:

Dang.  Can't remember where I got the Nginx directives for drupal, but here's the ones I'm using:


 

# Make sure files with the following extensions do not get loaded by nginx because nginx would display the source code, and these files can contain PASSWORDS!
        location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_ {
                deny all;
        }
 
       # Deny all attempts to access hidden files such as .htaccess, .htpasswd, .DS_Store (Mac).
       location ~ /\. {
                deny all;
                access_log off;
                log_not_found off;
       }
 
       location / {
                try_files $uri $uri/ /index.php?$args;
       }
 
       location ~*  \.(jpg|jpeg|png|gif|css|js|ico)$ {
                expires max;
                log_not_found off;
       }

Once that was in there, it all worked like a charm.

Now, this is a pretty tiny server, with only 256M of RAM. I've no idea how it would hold up under load and I haven't done any real performance tweaking yet.  That'll come, I expect.  The first thing I wanted to see was no "500 Internal Server" errors (nope), and then how long does a page take to load?

As my metric, I have Drupal's Devel module on and reporting page execution times.  With the same website database installed on three different hosts, pulling up the simple phpinfo page (another Devel bonus), here are the timing results I'm getting:

Page Execution Times for Devel's phpinfo under Drupal 7
Host Page Execution Time (ms)
hotdrupal.com 29
hostgator.com 265
rackspace.com 256M DRUIN 785
rackspace.com 512M DRUIN 171
rackspace.com 1025M DRUIN 173

I'll be doing more configuration optimization in future, I expect.  But I have to say, that hotdrupal.com account is looking pretty attractive right about now!

Commentary