SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Web Server and Configuration

    I'm just starting to explore Ruby and RoR. I installed them on my local computer (Windows) the other day, and so have been reading why’s (poignant) guide to ruby as an introduction to Ruby.

    Anyway, I'm really thinking of trying to develop in it for a personal project I want to work on. I installed ruby already on my server for something else, so just had to compile rubygems, and then install rails.

    But now I'm wondering which web server it's going to be best with. Well, I'm not really sure if I have a choice since I already have Apache running with SVN and such. But if I did, what would you say is the best option as far as configuration and an actual web server are concerned?
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  2. #2
    SitePoint Member
    Join Date
    Mar 2009
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've used RoR with Apache (FastCGI) and it works great. Lighttpd is also an option that is quite common.

  3. #3
    SitePoint Evangelist
    Join Date
    Feb 2006
    Location
    Worcs. UK
    Posts
    404
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Mongrel is fine if you aren't hosting a busy site. Great for development and intranets.

    If you need more power, Apache is an obvious way to go though servers like Lightpd are faster. The great thing is that you don't have to use FastCGI any more (setting that up was always the hardest part of getting a Rails app up and live). Apache mod_proxy is all you need nowadays.

  4. #4
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ReggieB View Post
    Mongrel is fine if you aren't hosting a busy site. Great for development and intranets.

    If you need more power, Apache is an obvious way to go though servers like Lightpd ar'e faster. The great thing is that you don't have to use FastCGI any more (setting that up was always the hardest part of getting a Rails app up and live). Apache mod_proxy is all you need nowadays.
    Interesting. I'm strongly considering going with lighttpd, though I'm not sure yet and need to explore all of the limitations first.

    One thing is I'm running SVN under Apache right now, though admittedly I'm thinking also of switching over to git. I also currently have Trac running under Apache and am not sure whether it would run under lighttpd or not.

    Also I will probably host other projects from clients there, and I hear lighttpd doesn't support htaccess, which might be a problem. I'm not sure, though, because it still seems to support mod_rewrite, and I obviously have control over whatever equivalent to httpd.conf it has, so could probably just include them in there.

    Anyway, just thinking out loud I guess. Thanks for the suggestion.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  5. #5
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Depends a lot on what you're doing.

    I don't trust apache with fastCGI; too many troubles. Perhaps they've finally fixed them, but apache/fastCGI was a problem child from the beginning, partly why so many other options were born.

    Staying with apache, there are a couple of choices. Easiest choice is to slide into apache and Passenger. From the coding side, passenger works just like mod_php does with PHP code. I don't think I'd use this for a heavy-traffic site, but should be fine for lower sites.

    Another option is to use apache as a load-leveling proxy for a group of mongrel servers. apache passes the requests, keeps the load balanced, and the mongrels run the ruby code. Harder to set up, but is better suited for heavy lifting.

    After that, your best options are to leave apache. One that hasn't been mentioned yet is NgineX.

    Also, as the Rails/merb merger goes ahead this year, lots of performance metrics will chance. One of the major bottlenecks in Rails speed is ActiveRecord, and the merger will render that optional, instead of mandatory, in Rails.

    Personally, I use mongrel locally for development, and most of my production sites use Passenger, as they so far haven't grown enough to hit the wall there. And maybe as they do, Passenger itself will move the wall.

    I'm a firm believer in not making decisions before they have to be made, which is why I've followed the path I did. Passenger makes deployment dead simple, and when capacity issues get closer and I have to decide on high-performance, I will.

    Chris Matts work on "real options" tells us:

    1) options have an expiration date
    2) it's *never* optimal to exercise the option early.

    The trick is, of course, finding that "last responsible moment" to decide on the option.

  6. #6
    SitePoint Wizard bronze trophy devbanana's Avatar
    Join Date
    Apr 2006
    Location
    Pennsylvania
    Posts
    1,736
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Arlen,

    Thanks for the ideas.

    I just found out about Passenger about 20 minutes before you posted, and already have it up and running , which says something for its ease of setup.

    I am concerned that you say it can't handle a heavy traffic site that well, but I guess i don't have to worry about that yet. I'm making a site that I expect to be popular, since there is nothing of the sort like it yet.

    While I know what I'm doing around the server, I'm not sure if I'm good enough to set up many Mongrel instances behind Apache, or even how that'd work, so hopefully the need for that is a long time off, or that Passenger can support heavier sites better before that time comes.

    That's too bad ActiveRecord is the slowest, when it also sounds one of the most attractive parts of Rails. Oh well, we'll see how it goes, I guess.

    Thanks again.
    Laudetur Iesus Christus!
    Christ's Little Flock
    Jesus is the Good Shepherd

  7. #7
    SitePoint Addict
    Join Date
    Feb 2007
    Posts
    270
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by devbanana View Post
    I am concerned that you say it can't handle a heavy traffic site that well, but I guess i don't have to worry about that yet. I'm making a site that I expect to be popular, since there is nothing of the sort like it yet.
    It all depends on the meaning of the word "heavy." If your traffic flow is going to rival facebook or twitter, I'm pretty sure Passenger will be your bottleneck. But there's a lot of configuration options inside of Passenger that you can use to help throughput, and if the traffic gets high enough, you can always choose hardware over software, and toss more servers into the fray.

    That having been said, it seems the Phusion folks are living up to one of my expectations, at least; performance is rising (The Ruby Enterprise Edition pages say it outperforms litespeed, for example).

    Oh, and the best news for Rails junkies is the huge speed boost coming with Ruby 1.9 -- true, it'll take the Rails community a while to catch up as finally fixing the broken Ruby thread model is as expected breaking a whole lot of other things. As this shakes out, your upper performance limit will be raised yet again. (But don't be in too much of a hurry. IIRC, the current release version of Passenger, 2.0.6, was one of the things Ruby 1.9 broke. The fix is in the git master tree, but it's not in a release version, yet.)


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •