Close and Go BackBack to Viget

Media Temple Grid Server on Rails

Kevin McFadden
Kevin McFadden, Former Staffer, November 29, 2006 4

Earlier this week I wrote about LiteSpeed. Besides potentially being expensive, it also requires having your own server or VPS.

Another option, great for traffic-moderate sites, is Media Temple’s Grid Server (GS). The basic set up costs $20/month and there is an option to add a 64 MB Rails container. All users appear confined to a chrooted environment, which is great because other users have no way of accessing your files, especially those hard-coded database passwords. For additional money, you can allocate more memory to the Rails container: $25/month for 256 MB and $75/month for 1 GB.

Creating a GS account is pretty fast and easy. About thirty minutes after entering my contact and billing information, I received my GS login information. The following outline describes how to deploy your Rails application.


  • Create a new domain for your account, perhaps myapp.mydomain.com.

  • Enable the Rails container in the Media Temple control panel https://accountcenter.mediatemple.net/.

  • Run mtr generate_config to avoid having to enter the user and pass everytime. This info gets stored in a ~/.mtr file in clear text, but it should be secure enough since no one else may access your home dir and it has appropriate permissions.

  • The instructions for installing the necessary files into your container are found in the MT Grid Server guide.

  • Create your database in the control panel (Manage Databases, not MySQL or PostgreSQL Admin.)

  • We have a slightly custom rake process, but perhaps the standard rake db:migrate RAILS_ENV=production will work for you.

  • The permissions of your application files must must be readable by the web server:

    # cd into the rails container
    cd $HOME/../../containers/rails/

    # All files should be readable
    find . -type f -exec chmod a+r {} ;

    # All directories should be executable and readable
    find . -type d -exec chmod a+rx {} ;



  • Don’t forget to update your production settings for the database, ActionMailer, and other deployment specific features.

After this is done, you should be able to access your application. You can manage your container from the command line using Media Temple’s mtr command. Run mtr -h for more information.

In the long run, it may be more flexible and cost-effective to go the VPS route if you have, or want to learn, the Linux side of things; but, if that isn’t your thing, the Grid Server is a good deal.

References

Ross said on 11/30 at 12:20 AM

When you recommend a service like this you do know how much downtime MT clients are expiriencing. You might want to check out my article here:

http://www.thehostguru.com/2006/11/29/the-grid-is-fallingthe-grid-is-falling/

Ross
- http://www.thehostguru.com
-----

Kevin McFadden - Director of Technology said on 11/30 at 11:45 AM

Hi Ross,

Thanks for the informative link.  This article wasn’t intended to be an endorsement of MT, but it was meant to be an exploration of an interesting system that supported Ruby on Rails.  We’ve been searching for a low-end solution that didn’t require the overhead of a VPS and wasn’t Textdrive, as they have their own set of problems and commenters. 

OTOH, Textdrive’s performance seems to have improved recently and their Accelerator offering looks like an interesting VPS/container solution.

Back to Media Temple’s “grid”, it’s still fairly new, and not that bad an option for $20/mo.  Hopefully the reliability will improve (today it seems much faster than usual...) to the point where it can be given two thumbs up.  For now, though, it’s still a wait and see option.

Kev

steve said on 01/23 at 09:40 AM

Actual Media Temple Grid Server Response Times

http://spreadsheets.google.com/pub?key=p-Ab3UaY590VDhZCTaDinHg

Dan Kubb said on 02/05 at 03:02 PM

I’ve recently had some good experiences running rails behind Litespeed at www.slicehost.com.  I was originally using Nginx and Mongrel, but since I only have 256 MB of memory I couldn’t fit more than 2 mongrels at once before hitting swap.  The LSAPI processes use way less ram and are perfect for a VPS.

We're the Developers

at Viget Labs. We write about web development trends, tips, best practices, industry events, and our projects — all with an emphasis on Ruby on Rails.

Recent Comments

Tony,

I understand and agree that the back-end shouldn’t output code (html code), and only content. The templates (aka views) should do the trick, but instead of having lot’s of if/else conditionals inside the view, you may just output the following content.

No information available

The template would loop in an array and put all the <li>’s inside the <ul>.
I don’t see anything wrong, nor...