Rails + shared hosting = application error

Is it actually possible to run a Rails application, even a simple one, on shared hosting? My answer is no. To my mind, this is still a massive Achilles Heel for Rails: it is virtually impossible to host without your own dedicated server.

Flickrlilli is the case in point. I have tried shared hosting twice for this, and failed both times; I tried a virtual server run by my friend schwuk and ran it under Mongrel for a while, but got worried I was making it fall over. I stripped the whole application down and rewrote it so it was less intensive, then put it on Dreamhost (though that may be partly down to REXML, which I had to switch back to from libxml-ruby as Dreamhost doesn't support it). Dreamhost itself has been fine, but my bloody application still falls over continually. Maybe I'm a terrible coder (though I have an ASP application I wrote in the dark days still running three years after I first deployed it, so I can't be that bad). Rails just seems inherently exhausting for servers to run.

If anyone wants to sponsor me to continue to host it, maybe I could put it up on MediaTemple or something. Otherwise, it will have to stay in its current crusty bedsit. I am frankly at a loss. In fact, it's got so bad, I've even considered switching back to PHP. Rails is great for my own "desktop" applications, but for hosted public applications, it's the pits. And it's not just me: I still run across "Application error" pages all the time on large, public, commercial sites. Come on, someone, let's make it easy to host Rails so normal folk start using it. (If only I could write Apache modules - mod_rails, anyone? Well, I suppose I could, but I have a full-time job and a family.) Remove the glass ceiling!

Maybe this is one for the Rails Way: though I'm slightly embarassed by the code, as it was one of the first Rails applications I wrote, and it is quite a mess - perhaps that is the problem, after all...

Comments

improvement...

I feel that the relatively undeveloped world of RoR makes it difficult to be deployed through a shared host. Hopefully, with improvements on web architecture, sites built on Rails can be as flexible as others.

Passenger is helping that

Passenger is helping that become a reality, making it much easier to deploy Rails apps on shared hosting.

re: improvement

The thing with J2EE and .NET frameworks is that they're backed by big businesses that have been existing for decades now. RoR is pretty much a new player in the court.

Go with those who know

While I am not personally familiar with Dreamhost or MediaTemple... I am the founder of PLANET ARGON, which was one of the first few companies that started to host Ruby on Rails applications. The issues that you're having are due to a bad deployment strategy.

As you're essentially running a daemon, the php/asp model doesn't apply here. One update to your application with FCGI... and your site is going to turn into an Application Error nightmare. The process running your application needs to fully restart and most commercial hosting don't give you this flexibility.

The solution? Manage it yourself with a hosting provider that understands the pains of deployment. I know of such a company... ;-)

Thanks for getting in touch,

Thanks for getting in touch, Robby. You're right, it is a pain for me to restart FCGI manually, though from what I can see Dreamhost does do a limited amount of FCGI respawning (I think). I can kill the FCGI processes myself, but only from the command line. I often recommend my clients to Planet Argon, as I've heard many good things about your service: I'll bear you in mind once I get round to moving!

Freeonrails.com

Hi,

I run a server on Litespeed for freeonrails.com ( yeah, it's free :) ) and my own apps. And it works like charm. No more application errors unless there is really an error.

Feel free to drop me an email and I'll set you up with an account on my server :-)

Thanks!
Pratik

That would be much

That would be much appreciated! Are your contact details the same as the ones for Thinkwares?

Yup. root aT thinkwares.com

Yup.
root aT thinkwares.com

Dreamhost = bad rails performance.

Dreamhost is the issue. I have the same issue on a couple apps we (unfortunately) still have running there. It's obviously flawed because they take 1-2 minutes to start responding, if they respond at all. For static content, php, subversion, they rock. Rails, no good. :)

All my new sites run on a dedicated box with mongrel / apache 2.2. Rock solid, fast, never down.

That was initially painful. The past year has been a massive crash-course in Linux administration, when all we really wanted to do was build web-apps. But it's worth it in the long run, knowing how to run things yourself.

Thanks for the comment. I

Thanks for the comment. I agree, Rails on Dreamhost is bad. I would love to have my own Linux server (I can do a fair bit of admin. myself :)) but can't afford a dedicated server. I just can't justify the price for my hobby projects. The point really is that I'd like Rails to run like PHP on shared hosting: so that it can become a commodity, the same way PHP as. Maybe that's just plain impossible. If this could happen, I think people would be far more likely to move to Rails from PHP. I honestly think that's the main sticking point for Rails, and the number one thing that people complain about.

I agree mostly

I'm currently deploying on dreamhost and for the most part it is doing well. I sometimes do get those error pages but for 95%(i just made that up) of the time, it works. My only problem is the amount of time it takes to serve the pages.

FlickrLilli has been fine,

FlickrLilli has been fine, but as soon as it gets even a small amount of traffic, it falls over. I don't want yet another hosting account to look after (I already have two), and it's not like I get paid anything to host it, so it will have to stay where it is. Though the source code is available to anyone who wants it, if they want to run their own instance.

Webfaction

I've heard a lot of good stuff about Webfaction.com. Have you tried them?

I agree, deployment is the big downside compared to PHP. No matter how you look at it hosting rails is more costly than PHP and ASP.

Thanks for the suggestion: I

Thanks for the suggestion: I had seen it, but not really looked into it much. Plus I bought my hosting when Rails hosting was still very expensive, and went for a company which simply mentioned it. I think a lot of these dedicated providers have a much better idea what to do. But until your average bloke can install a Rails app. as easily as he/she can install a PHP one, on $3 a month hosting, and have it stay up reliably, it will stay in the niche.

Maybe not easy but it is possible

I must agree that Rails apps + 3 $ a month hosting means trouble, but you can find a little more expensive hosting that actually works. We have managed to serve peaks of 70 K pages with a shared hosting account, take a look at RailsPlayground, they do know what they are doing.

Thanks for the suggestion.

Thanks for the suggestion. Admittedly, Dreamhost is the cheapest of the cheap. But I also tried to run the app. on Site5 half-decent hosting, and failed there too. Whereas PHP apps. (like Drupal) will run happily serving thousands of pages per month. That's really my point: I don't want to spend more money to host one Rails application which is only a hobby for me. It's more cost effective to run my own LAMP stack for local use. True, if I was making any money or running a commercial service, I would definitely give RailsPlayground a look, as it's always being recommended. And it might be worth it for me to shift my hosting (once again!) when my current Site5 account runs its course as RailsPlayground offers PHP too.


You are viewing a mobilized version of this site...
View original page here

Mobilized by Mowser Mowser