Tuesday, June 14, 2011

The maze of finding a good VPS hosting for Drupal and other CMS

I went through the maze of finding a good VPS hosting for a relatively database heavy website (typically any CMS will be in that category, Drupal, Joomla, Plone, Ruby on rails, etc...). So I thought I would write up how the experience, the traps and the final solution I found.

Shared hosting, VPS or dedicated ?
  1. Shared hosting is typically the cheapest alternative, advertised with those super cheap prices (like less than $5 a month). However in practice, unless you just host a few raw HTML pages, your site is going to crawl if you use a MySQL database. If it crawls, most often hosting companies while claiming unlimited this and that will just turn off your website, I've experienced it, many others did.
  2. VPS hosting was recommended to me by my initial hosting company (InMotionHosting) after they unilaterally turned off my website without even notifying me (not to mention I was mad). Their argument was I was using too much resources, time to move to Virtual Private Hosting, which basically is a shared hosting with a fixed amount of resources allocated to you. Now the price varies between $20 to $40 a month for the entry plans between companies.
    • Watch out: there are two types of VPS hosting: managed and unmanaged, I'll explain more about them later.
  3. Dedicated hosting is when you have a full server at your disposal, it will often cost you more than $100 for a entry plan.
So in my situation, I decided that VPS was probably right for me, I don't have a 100.000 connexions a day but at the same time the website is growing and I need a MySQL that responds relatively fast.

What hosting company ?
Now, if you're like me you type "Best VPS hosting" in Google, and you get tons of results that look faked. And they are (faked), many hosting companies pay people in India to post positive reviews about them, that's called backlinking. So they all can claims they are the best. Now in practice, it's far from the truth. Actually a funny event happend, someone posted in my phpBB forums a spam back link for my own hosting company (InMotionHosting), how stupid is that ?

But at first, I fell for the trick and initially signed up for a hosting based on those faked review, the speed was abysmal but I thought naively that it was normal.
  • InMotionHosting:  Then I moved on to another "best hosting", InMotionHosting which basically may be good for shared with basic HTML pages but with Drupal pretty much forced me to go to a VPS. Once on a VPS the performance improved but remained poor, the loading time for the front page on average took 2 seconds and sometimes it would take as much as 60 seconds to load. The customer support could never reproduce the issue (forget about user support for anything that doesn't happend all the time, like an intermittent huge loading time) and they didn't even try. They could have written a script in 5 minutes to load the front page every 10 minutes to measure the load time, they didn't.
  • HostGator: So I decided to finally give a try to the next big name, hostgator. They may be good at shared hosting but while their VPS was faster than InMotionHosting, it still remained slow. Page loading, would take 2 to 8 seconds for my front page. Their VPS comes with CentOs 5.6 and all packages feel obsolete (python 2.4.3, etc... they offer python 2.7 but only for shared hosting...). Their live customer support would deserve an entire blog post to tell the horror stories that have happened to me. Their SQL response time was slow as hell (same config as at my home, the queries took 3 time longer to execute).
These companies are reputed as shared hosters but the VPS value remains low. Their VPS are managed (or semi-managed) which basically means that you get an often incompetent user support to spend hours chatting online. But it's reassuring, someone is helping you even if it's of no help, they provide a chat log so you can show your boss it's not your fault that nothing is working. Yes reassuring.

The world of unmanaged VPS
Here basically you're on your own, you get the server, and you need to install everything without a user support holding your hand. And that's what I finally tried with Linode.

I chose to use the Ubuntu 10.04 Linux VPS (it's a cloud server, but VPS and cloud are pretty much the same thing, just that clouds allows cloning). Installation is simple, you get a SSH shell, you install Apache and whatever you need, it's as simple as apt-get. The packages are up-to-date (being Ubuntu) so you don't really have to compile anything.

In 1 hour, I had the whole site setup and working. The performance is excellent, loading the frontpage takes 250ms. The cost is half of what I was paying with InMotionHosting and HostGator.

Final word
My point here is not to make a commercial for Linode but to relate my experience through years of hosting quest. There are probably others who are offering a good VPS hosting, however I didn't use them so I'm not going to comment on them.

The lesson that I learned:
  • Stay away from big shared hosting companies if you want VPS hosting
  • Go for an unmanaged VPS hosting company, the performance is incomparable, they offer a lot of documents to help you configure your server and you can always find help by going to IRC and chat.
Performance comparison of my page load times
Those times where measured using Firefox:FireBug->Net load time analyzer.
Company Average load time Worst load time
InMotionHosting 1-2s 60s
HostGator 1-2s 8s
Linode 0.25s 0.5s