VPS for RoR review

Posted by bikethetam Mon, 09 Feb 2009 02:54:00 GMT

I’ve been wanting to try one one those Virtual Private Server hosting solutions for some time. Today was rainy day, I consequently spent the day on it. I started my search on that railshostinginfo.com and resolved to start my investigation with railsplayground.com. That company offers the cheapest credible deal and has a good reputation on the rails-talk mailing list. The price is $15 per month with a 12 months commitment for 256MB memory (up to 512MB spikes, what that means exactly I don’t know), 10GB disk space, 100GB. bandwitdh.

Getting started: 5 minutes after I entered my CC number, the server was up and running.

I went for the Ubuntu 8.04 server since this is distro I know well.

First impressions:

  • I logged in with ssh, the server is very responsive, not the slightest delay when typing.
  • Nice web console that allows you to track the status of your server.
  • As specified, 10GB disk is available.
  • The Ubuntu setup only has the bare essentials, no mysql, no apache, no compiler, no ruby.
  • The internet connection appears to be lightning fast.
Memory The ‘free’ command before I started any daemon reports: root@myvps me # free
total used free shared buffers cached Mem: 524288 17860 506428 0 0 0 -/+ buffers/cache: 17860 506428 Swap: 0 0 0
That means 512MB available, but don’t think about relying on swap space.

Setup:

  • apt is setup with only the main repository without access to updates, you’ll need to add the universe to /etc/apt/sources.list:
deb http://us.archive.ubuntu.com/ubuntu/ hardy-updates main restricted deb http://us.archive.ubuntu.com/ubuntu/ hardy universe
  • “apt-get update” to get your local cache up-to-date
  • “apt-get -u upgrade” to upgrade everything
Packages to install with “apt-get install ”:
  • mysql-server
  • ruby
  • build-essential
  • wget
  • rdoc
  • ruby1.8-dev
  • libmagick10
  • libmagick9-dev
  • irb
  • libfcgi-ruby1.8
  • libmysqlclient15-dev
  • libopenssl-ruby
As for the rubygems, I prefer to install it from rubygems website rather than from apt-get. That allows for OS upgrades that don’t destroy the already installed rubygems. After untarring the package, simply run “ruby setup.rb”. Note that it will fail unless rdoc has been setup previously.

After that, install the needed gems:
  • rails
  • gruff
  • mongrel
  • willpaginate
  • mysql
  • rmagick
Database Mysql is necessary but I soon as it’s started, almost 140MB of memory are gone. I thought that maybe I didn’t need innodb for now and I uncommented “skip-innodb” in /etc/mysql/my.cnf. Restarted mysql, memory usage is now down to 55MB. Yay!

Web server I naturally started with Apache that I intended to run with mod_fcgid. But, wow, right after setup with all the default options, Apache takes 250MB. It’s a no go.

Mongrel is a good replacement except that it only gives you one process listening for client requests. On the other hand, the memory footprint is less than 40MB.

I decide to give a try to Lighttpd that I have never used before. That’s a winner, the instructions at http://wiki.rubyonrails.org/rails/pages/Lighttpd are a breeze and it uses just ~25MB per lighttpd process. I don’t need more than 2.

Overall I’m very satisfied, everything is running in less that 115 MB, that leaves 385MB of memory and 9G of disk to spare. My fear that the 256MB VSP plans were just teasers was not justified. I originally just bought one month but I think I’m going to convert that to an annual subscription.

Leave a comment

Comments