SitePoint Sponsor

User Tag List

Results 1 to 12 of 12

Thread: Fast RoR Sites

  1. #1
    O Rly?? JakeJeck's Avatar
    Join Date
    Nov 2000
    Location
    Milwaukee
    Posts
    571
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Fast RoR Sites

    I found one RoR site that is probably one of the fastest sites I've ever seen.

    http://www.everythingcute.com/ check out the product pages and how fast they load.

    Anyone else know of any super fast ruby sites? The more I read about it the more I'm thinking of switching from asp.net over to RoR.

  2. #2
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think it http://www.43things.com is a decent example.

  3. #3
    l 0 l silver trophybronze trophy lo0ol's Avatar
    Join Date
    Aug 2002
    Location
    Palo Alto
    Posts
    5,329
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by JakeJeck
    http://www.everythingcute.com/ check out the product pages and how fast they load.
    Yes... but then, I doubt that that page is fighting back the crowds.

  4. #4
    SitePoint Zealot
    Join Date
    Nov 2004
    Location
    Yakima WA.
    Posts
    100
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You need to realise that Rails includes a very nice caches_page function that will take on of your actions(page) and the first time it is hit Rails will write the entire page to a raw .html file in your public/ folder. Then the next time anyone hits the page it is served as fast as your web server (usually lighttpd which can serve static content fast enough to saturate you pipe) can serve static .html files. And then you declare an observer on you model that supplies the data for that page. This observer watches for changes to the data that the cached page uses and when said data changes it erases the cached .html file. So next time someone requests the page a new .html cache file is written and the requests continue to be _fast_.

    Even so rails can generate most dynamic pages very fast in and of itself but the caching features make your sites perfrom very well if done right.

  5. #5
    SitePoint Addict Brak's Avatar
    Join Date
    Jul 2004
    Location
    Central Coast, CA
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Largely the speed increase is due to a large portion of production rails sites running on lighttpd. lighttpd + cached pages = love.
    Studio Rockstar's Blog - A journey to quitting the dayjob.

  6. #6
    SitePoint Zealot bronze trophy
    Join Date
    Jun 2004
    Location
    Stockholm, Sweden
    Posts
    148
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are there any performance comparisons on lighttpd vs. apache, with focus on RoR of course?
    If there is a way to overcome the suffering, there is no need to worry; if there is no way to overcome the suffering, there is no point to worry.
    - Shantideva

  7. #7
    Your daddy. WALoeIII's Avatar
    Join Date
    Apr 2001
    Location
    USA
    Posts
    526
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lighttpd is faster, but less versatile than Apache.

  8. #8
    SitePoint Zealot
    Join Date
    Jul 2004
    Location
    Oklahoma
    Posts
    119
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by WALoeIII
    lighttpd is faster, but less versatile than Apache.
    I would actually say that it's about as versatile as Apache, its just not as well supported at this point. It is also not yet available natively for windows.

  9. #9
    SitePoint Addict Brak's Avatar
    Join Date
    Jul 2004
    Location
    Central Coast, CA
    Posts
    321
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yep.

    http://www.lighttpd.net/benchmark/

    Though, to be fair Ruby has almost no impact on the speed increases. It's all about having solid fcgi support. Apache's fcgi support isn't very good at all. The new scgi works for RoR specifically might change this a bit, though.

    Lighttpd vs Apache for static pages is of almost no comparison. It's like racing a cheetah against a hamster. It also scales up much better.


    As far as versitility, yes Apache is a lot more versitile. But at the end of the day do you need versitility? Or do you need a webserver? Why use a sledgehammer to open a walnut?
    Studio Rockstar's Blog - A journey to quitting the dayjob.

  10. #10
    SitePoint Member
    Join Date
    Aug 2002
    Location
    London
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I'm the guy who actually developed everythingcute.com last year. Even though the current server has RoR 0.13.1 installed, the site was actually developed before RoR had caching as one of features and so doesn't make use of this. Technology wise Its really a demonstration of what Rails was capable of during November 2004 as this is when the re-write was done.

    Also I'm a strong believer in not wasting time optimising until it is needed. Sure, code intelligently but the simplest possible solution is usually "good enough", and refactoring a piece of poorly performing code is easy enough as long as you have a good test suite.

    Most of the sites I develop now use Apache2 with mod_proxy for serving up the Rails stuff via Lighttpd. However EverythingCute.com uses Apache2 with mod_fcgid instead of mod_fcgi. I found it far more performant and stable than an Apache 1.3 setup with simple mod_fcgi.

    Sure the site is no Amazon, but it does get very busy. Which is why sessions where moved to memcache as after a few months the only real bottleneck turned out to be the database. When sessions were kept in the db, things *did* get very slooooooowww under high loads.

    Ruby on Rails sites are generally very fast. The current project I'm working on for a different client is actually a rewrite of a Java application that took 3 years to develop. The old application used to run on a 4 processor solaris box, while the new app runs on a vanilla Dell server with less than half the ram. I don't have any solid benchmarks, so please take what I say with a pinch of salt, but users are noticing that while they used to have to wait for certain operations to complete, now its almost instant.

    Just to make things fair though and put things in perspective, the old app was a full blown J2EE application using a CMP2 and hibernate mix, that managed transactions across two seperate data stores, one of them being an Oracle 9i database, with the middleware running on a seperate server from the database.
    The new app uses a pimped up version of MySQL replicated over two servers, with the application on the same box as the master.

  11. #11
    SitePoint Enthusiast mas22's Avatar
    Join Date
    Sep 2004
    Location
    SoCal
    Posts
    81
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Regarding the alternative called mod_fcgid... the install.txt file within the mod_fcgid.1.06 zip file from http://fastcgi.coremail.cn/ indicates that one performs an "nmake." Pardon my noobness, but any suggestions for those of us who are not prepared to compile, but just need a good, old-fashioned bin file?

    And you're right, everythingcute.com does move along very well.
    - Mark -
    SitePoint Noob
    "Anyone get the number of that jar file?"

  12. #12
    SitePoint Member
    Join Date
    Aug 2002
    Location
    London
    Posts
    11
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For Rails applications I really do like deploying to FreeBsd. The ports collection makes installing things a doddle and if you don't want to compile then there's pkg_add -r to install remote binaries. Compiling mod_fcgid was very easy under FreeBsd. The hardest part was figuring out how to configure it which wasn't too hard really.

    As for Linux distributions I vaguely remember Debian having a binary package that you can you use apt to install.
    I'm afraid I don't know of any binary fgcid packages for windows though.

    Hope this helps in some way


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
  •