The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Ruby and Webservers

Ok, think MySpace...
What would "Tom" use if he had to run MySpace on Rails?

We know that Webrick is small potatoes. Too small in fact, toss it back in the ocean.
We know that non-fastcgi is too slow - Apache or otherwise.
Obviously Apache is good but reports show that v2 is unstable with fastcgi - So what? Back to 1.3? Hmmm.
Lighttpd is fast, but does it scale? And how about support? (no Windows direct either, only Cygwin).

I'm no expert, but it doesn't take one to see the answer is not clear. Strange to me, since the answer is so important.

Again, can RubyonRails handle the real world (ie, Ebay, Amazon, Yahoo, MySpace) or will it be merely the small site's fun language??

(And while we're at it, has anyone hired a Rails host that has been fast and reliable, meaning unbroken uptime? ie. noticed plug for railsplayground.com on stoavio's "ruby resources" post above...)

Ok, think MySpace...
What would "Tom" use if he had to run MySpace on Rails?

He'd probably use the worst software possible judging by his site's total lack of stability.

Originally Posted by mas22

We know that Webrick is small potatoes. Too small in fact, toss it back in the ocean.
We know that non-fastcgi is too slow - Apache or otherwise.
Obviously Apache is good but reports show that v2 is unstable with fastcgi - So what? Back to 1.3? Hmmm.
Lighttpd is fast, but does it scale? And how about support? (no Windows direct either, only Cygwin).

Lighttpd is probably the best bet here. I don't know anyone who would get Windows hosting for Rails so I don't think it's much of an issue.

Originally Posted by mas22

I'm no expert, but it doesn't take one to see the answer is not clear. Strange to me, since the answer is so important.

Again, can RubyonRails handle the real world (ie, Ebay, Amazon, Yahoo, MySpace) or will it be merely the small site's fun language??

Myspace is the real world

Remember that Rails hasn't even hit 1.0 yet, and Ruby is going to version 2.0. The Ruby 2.0 interpreter is supposed to be orders of magnitude faster than the current Ruby interpreter (this is where the real bottleneck is), so odds are you'll see performance comparable to PHP/Perl in the not-too-distant future.

Originally Posted by mas22

(And while we're at it, has anyone hired a Rails host that has been fast and reliable, meaning unbroken uptime? ie. noticed plug for railsplayground.com on stoavio's "ruby resources" post above...)

I've been with Dreamhost since this weekend. They have Rails support but I haven't put it to the test yet.

http://www.planetargon.com/ has great rails support. It is run by Robby Russel who is writing a rails book for O'Reilly so he knows his stuff. I have found his hosting to rock solid. You might want to also consider a VPS. Here's a good provider for VPS: http://rimuhosting.com/order/startorder.jsp#miro . You can get on for around $20-30 that will work great for multiple rails apps.

Also at this point lighttpd proxied behind Apache is the only way to go for shared hosting. If a shared host only uses Apache then it is going to need to restart apache every time some one updates their rails project for it to reflect their updates. If they use and Apache front end and give every rails user their own lighttpd on a higher port proxied behind the apache front end, then rails users can restart their lighttpd servers without a global restart.

I am using lighttpd/fcgi for many rails apps that I coded and it is very stable and much faster and more scalable than apache. The largest rails site I have made and deployed on lighttpd/fcgi is http://yakimaherald.com. It gets around 60,000 page views a day and only uses a small amount of caching as most pages are very dynamic and pull data from multiple places to build a page. I started the app on apache1.3/fcgi but soon switched to lighttpd.fcgi and it is much more stable/faster and much less resource intensive than apache.

I have great config files for lighttpd.fcgi and for setting up the proxy to lighttpd behind apache if you need them. Just post here and let me know and I'll post the config files for you to use.

Very good, Ezra. This is exactly what I was looking for...
Thanks for the great info!

Four small questions:

1) I'm not sure what the acronym VPS stands for... and 2) why would you want VPS versus using 'planetargon,' as you referred?

And your work is VERY impressive on http://yakimaherald.com. You should be very proud of a job well done! 3) Are they hosting their own webserver?

To respond to your offer, I would love to get a copy of your configuration files regarding "setting up the proxy to lighttpd behind apache." 4) I am assuming that you are running this stack on linux?

Again, thanks tons, Ezra.
Mark

1. VPS stand for virtual private server. It is usually a linux distro that you get full root access to install and configure however you like. The way it works is the provider splits up a physical server into multiple virtual servers so instead of shared hosting where what other people do can affect your hosting, everyone is sandboxed from each other and to you the user it acts just like you have you own server box. Highly recommended for rails as you can get everything just right and you can host multiple domains with whatever services you want.

2. See above.

3. Yeah I am the webmaster for the Yakima Herald-Republic. We are running the site on its own dedicated Apple dual G5 Xserve in our data center. Even still the whole site is only using about 16% of _one_ processor at any given moment so we have tons of room for more rails apps and to expand as we get more and more traffick to our sites.

4. The prefered OS for running rails apps are as follows: OSX, BSD or Linux. The configuration for these OS's are basically the same.

Here is what an Apache virtual host that proxies to a lighttpd server on a higher port looks like( apache version is 1.3.x):

Here is a good config file for a dedicated rails app on an instance of lighttpd. This includes php/fastcgi as well so you can still knock out smaller .php script if you want and serve them up from the doc root of your rails app:

This is the same lighttpd.conf file that is running http://yakimaherald.com. The three fastcgi.server ".fcgi" = parts each create 4 fastcgi dispatchers for a total of 12 ruby fastcgi processes. This easily runs 60,000 dynamic page views a day and I expect that this same conf will scale to around 150,000 page views/day before I need to add any more fastcgi listeners. The php/fastcgi part spawns 24 php fastcgi listeners and is plenty for a ton of php processes. In order for php to work with fastcgi you must compile php with fastcgi flags. So compile php with whatever flags you normally would for apache but leave out any apsx flags and add these for fcgi: