Jan 9, 2008

Shared Hosting is a Ghetto

I haven't said much in defense of Rails in the past few months, but a recent post on Dreamhost's blog left me irked. Now that I see that the post is still making the rounds, it seems time to respond.

The most popular sound bite from the post:

"The feeling I get from the Rails community is that Rails is being pushed as some sort of high-end application system and that makes it OK to ignore the vast majority of user web environments. You simply cannot ignore the shared hosting users."
Huh. Well, the Java community ignored shared hosting users. The Python community ignored shared hosting users. Basically every development community save Perl and PHP have stayed the hell away from shared hosting. Why? Because shared hosting is a ghetto (please forgive the topical reference).

As a web developer, dealing with shared hosts is a nightmare. Sure, setting up a server from the ground up has historically been a nightmare too, but I'll take that over shared hosting any day. The constraints, the instability, and the unpredictability of a shared hosting environment are a big part of the reason why the web hosting business is moving towards virtualization everywhere you look. Big kids need their own sandboxes to play in.

As a programmer who wants to get paid for my work, making an application that I sell to people who then install it on a shared hosting account doesn't sound like a great way to make a living. If you'll excuse a callous generalization, it's a support nightmare for a down-market customer base. Plus, nobody but nerds (who don't pay for software anyway) install their own web applications anymore. People use hosted services.

Is it any surprise that even big PHP and Perl applications like WordPress and Moveable Type now offer hosted services (WordPress.com and TypePad, respectively)? Hosted services are a better way to make money in the web development business, and Rails is a better fit for such projects. Case in point: everyone bitches that the various Rails blogging applications don't work well on shared hosting accounts, but scores of bloggers are moving over to Rails-based hosted tumblelogging service Tumblr. Update: Commenters have clarified that Tumblr is built in PHP. Hopefully my point remains intact.

My guess is that the Rails community hasn't invested time in supporting shared hosts because it's simply not worth it. Extra work for users, extra work for developers, and where's the value? It sounds like Dreamhost is overselling this problem (much like they oversell capacity).

22 comments:

Greg said...

I totally agree. Also, it's not very much in the spirit of open source for Dreamhost to be crying out for someone to fix their free software for them, especially when none of the Rails contributors actually deploy on shared hosting for exactly the reasons you specify.

"If only there was someone with a budget, a financial stake in having Rails work on shared hosting, and some experience with the types of problems that arise to fix the framework," quoth Dreamost? How about look in the bloody mirror and pitch in to do your part to fix the problem? Not only would it be the right the right thing to do, but it would also make them a bunch of money from all the newbies who are familiar with shared hosting and looking to try out Rails.

But why make a productive contribution when you can just jump on the FUD bandwagon?

homer said...

Breath before you burst something!!!!

good post.

joao said...

"Rails-based hosted tumblelogging service Tumblr"

Not related to the main subject of your post, but I believe Tumblr is built in PHP, not on Rails

topfunky said...

The Rails Podcast site is actually hosted at Dreamhost. Every public-facing page is page cached, so it's basically a static HTML site.

If your site can't be page cached (most blogs could be), a VPS is the best bet.

Most of the time I login to my Dreamhost account, the load is over 15, so I wouldn't want to host a mission-critical site there.

Scott McMillin said...

Indeed, Tumblr is built using a custom PHP-based MVC framework.

Jake said...

I think that shared hosting does have its place. I have several fairly low traffic sites hosted at RailsPlayground and have not had any problems at all. In fact, I have never even had a problem with the apps running too slow. Setting up a VPS is probably the way to go for a lot of apps, but for what I use it for, shared hosting, at least at RailsPlayground, has been great.

jonbro.tk said...

out of curiosity, are you still using slicehost? I am afraid to touch my current rails project because it is running relatively well, but I wouldn't mind being on a nicer server.

James Adam said...

I've got some Rails stuff hosted on Dreamhost, and don't really see many problems with it. Admittedly I'm a bit of a power user (I use my own Ruby/Gems), but I still find it perfectly acceptable for the price.

Like topfunky says - I wouldn't run anything critical there, but it's fine for toy projects. And the average load I'm seeing at the moment is a little under 2.05 - not great, but not awful, really.

daniel said...

Collective Idea is hosted on DreamHost, as are a few tiny apps, but I echo topfunky that you can't really do many production sites.

It think its disappointing, but at the same time Rails (and Java) are different beasts than PHP/Perl and don't play well with shared hosts. I think it could change, but really Ruby is more of the problem than Rails.

That said, I'm helping move a tiny Rails app to DreamHost this afternoon because their old shared host can't figure out how to keep anything working.

Srdjan said...

While I hear all of you guys who say that shared hosting is not a way to go for Rails websites, here's my problem with that opinion.

I have clients who are not willing to pay a lot of money for hosting, since they're unfamiliar with the web and how it works. If I want to keep overall costs down, I'll want to use something like Rails to help me get their websites up and running quickly. If there's a problem with those websites because of web hosts having pains setting up Rails, I will either suffer by losing clients or suffer by trying to solve the problem that I cannot bill. After all, it's not like it's a problem with the website itself. These clients also will not want to pay the increased prices for VPS hosting, which is still more expensive than shared hosting. It is in my best interest to have Rails be as good on shared hosting servers as it is on a VPS or a fully dedicated server.

I'd love to get involved in solving this problem, but is this something that I can do without owning a hosting company? What do you guys think of that?

al3x said...

Joao and Scott: I've corrected the bit about Tumblr. Thanks!

Jonbro: This domain is entirely hosted by Google and Amazon S3. I use Google Apps for email and Jabber, Blogger to handle content and some images, and S3 for larger files. My favorite registrar, Gandi, makes all the forwarding and DNS magic simple and free (included in annual registration, anyway). Gandi is rolling out a VPS hosting plan that's cheaper than Slicehost and looks awesome. I'd still recommend Slicehost for small- to mid-size Rails projects, though.

Srdjan: There are plenty of VPS hosting solutions that are priced competitively with Dreamhost. They may not advertise unlimited bandwidth and absurd amounts of storage, but that's because they're being honest.

sillygwailo said...

Requisite Digg link: http://digg.com/programming/Shared_Hosting_is_a_Ghetto

Matt Schnitz said...
This post has been removed by the author.
Matt Schnitz said...

I don't think it should be this game of whether Rails is high-end only or ghetto only. Because I don't think the distinction exists. There's a spectrum of deployment. Rails could do more for me, as a server-on-a-shoestring developer with moderate traffic on a single dedicated host (FP).

I'd love to have the ability to deploy my server, stripped-down, on a cheaper shared host. We need separate test deployments. It'd also help me add developers. Right now, I'm forced to set up new Windows-based volunteers on VMWare/Linux.

I'd also love not to have to spend hours walking new people through the system install.

I don't always think of a shared host as a ghetto. They can be useful in a variety of situations.

Greg said...

I really disagree with this idea; there's no way to just say "shared hosting doesn't matter" and wash your hands of it; where do you think developers test things, where do they learn, where do they do staging? Shared hosting.

Rails, as it stands, is almost impossible to run on shared hosting, and I think Dreamhost (while obviously wanting their customers to be able to use Rails,) has a point in that shared hosting has some uses, and at some point, it is beneficial to at least provide a minimal level of support for shared hosting.

david said...

Developers test things on their own machine, locally. Nearly every single shared host existence has a clause about doing development in the shared environment. In that, you don't.

wyldeone said...

Those saying that rails doesn't work on shared hosting are missing something: it does. Just poorly. Dreamhost has actually gotten something that works, most of the time. The problem is that for production sites "most of the time" doesn't cut it.

The biggest problem I've found hosting rails on dreamhost (I've since switched to slicehost, and it's incredible) is that the load gets too high on the server and my fastcgi processes get killed. It then takes apache a few minutes to restart them, during which time my application is unaccessible.

However, for non-mission critical apps or for development or testing, it works fine. But if you can't spent $20 a month for a slicehost account, is your service really that important?

Watts said...

But if you can't spend $20 a month for a slicehost account, is your service really that important?

To the person running that service, yes.

I'm sympathetic to Alex's point here from a technical standpoint. But to stretch the ghetto analogy a little farther than perhaps it should be stretched, people who are living in ghettos are, you'll find, rarely there because they're just too cheap to move to the nicer parts of the city.

The Rails community seems to implicitly assume that everyone writing a Rails application is aspiring to be the next Basecamp. That's not necessarily true. There are people and groups who have absolute shoestring budgets and no "business plan" who nonetheless might want to put up a website more complex than a weblog or a forum board.

There may be other solutions for this than shared hosting, to be sure, but making Rails play nicely with shared hosting is perhaps not a bad idea. (from what I can tell, the Python people really are taking this seriously, with developments like mod_wsgi.)

tommorris said...

Here's something that annoys me about this. I use shared hosting for my blog. I'm also organising a BarCamp - so built a website for the event. My host supports PHP5, Perl, Python and Ruby (in that order - it also supports Rails, but you have to engage in quite a bit of dark magic to get it working). So I built the code for the site in PHP5. It's quite simple, but I wanted some advanced features in this throwaway app.

Unfortunately, the only library that supports the advanced features is written in Java. Presumably, I should pay to get a Java host - and then if I want to run a Rails site, I should pay and get a Rails host too.

Well, screw that. I built most of the app in PHP and then wrote a Java servlet to handle the little bits that needed doing in Java, stuck that on Tomcat running on a spare Mac box hooked up via DSL at my house, and just post information to that via HTTP when it needs to use the advanced features.

I'm not a software developer, but I need to solve problems. And shared hosting solves 90% of my problems. This is something I think the Java and Rails community gets wrong - not everything is a Web application - sometimes things are just old fashioned Web sites with custom interaction.

Some of these people would be well-served by using a different approach than PHP/Perl - whether it's Ruby/Rails, Python or even Java. But those avenues are being closed off not because PHP is a better programming language, but because they haven't got the time or resources to host the other stuff.

As for the distinction between web apps and websites? It's a continuum, not a boolean - the continuum has static HTML at one end and Gmail or Basecamp at the other, and in between a lot of stuff that we have to piece together by hand without the help of frameworks or supportive web hosts, since the frameworks and hosting providers tend to target only a very specific part of the continuum.

And where do the college kids learn to code? Well, they learn by having cheap or free crappy hosting, and pushing it to it's limits. Sorry, but when you are in college and trying to pay the rent and food each week, you haven't got enough to pay for dedicated or VPS hosting. This is why they learn PHP - because you can actually deploy the small applications you develop. Otherwise, you are stuck running it on your localhost - and, to be honest, a web app without users is rather a pointless exercise.

Web applications exist to solve problems, remember, not simply to make software developers money.

Luke Francl said...

Shared hosting definitely sucks and I know the hosts always oversell, etc, etc. But it has its place.

I work as a Rails developer full-time and we of course use dedicated hosting or VPS for our clients. But as a hobbyist, I just want to play around with stuff -- but actually launch it for the real world. But I don't want spend all my spare time doing sysadmin crap and installing security patches. I want a hosting company that handles most of that stuff for me.

I have a Dreamhost account which I use to run a few websites and I would love to deploy Rails apps to it, but I'm not willing to fight against the shared hosting limitations. I think this is hurting the adoption of Rails in the low-end market, which is where a lot of programmers get their start (and have their fun).

I didn't know (until this shared hosting discussion came up) about Slicehost's $20 a month plan. That's only twice what Dreamhost charges so it's worth looking into as an alternative.

david said...

There's also shared hosts that (according to reports) do Rails pretty well, like Segment Publishing.

tercumenette said...

nicepost