Brandon Keene's blog



Brandon KeeneBrandon Keene
Standup 11/14/2008: XXL Mongrels and Non-Model Reports
edit Posted by Brandon Keene on Saturday November 15, 2008 at 02:04AM

Interesting Things

Ask for Help

"How big should a typical mongrel be? Ours is starting out at over 200 megs but is not leaking from that point."

Everyone agreed that 50MB to 70MB is standard and anything over 100MB is considered pretty big. People suggested RubyProf for inspecting object counts and possibly tracking down the memory hogging code.

"What pattern does everyone use for non-model Reports with ActiveRecord? We are trying to create a report that counts a single model and groups by two associated models"

There was consensus around modeling a distinct report object and calling the referenced models. For example, FooReport and FooReportController fit nicely in a RESTful Rails world.

Brandon KeeneBrandon Keene
Standup 11/11/2008: Firefoxen goodness
edit Posted by Brandon Keene on Thursday November 13, 2008 at 01:20AM

Interesting Things

  • In response to our ask for help, Ray Baxter answered us in code with a script called Firefoxen. "It’s a script to automatically configure multiple installations of Firefox so that they open with different profiles." You can grab Firefoxen on GitHub. Thanks Ray!
  • IE7 sends odd Accept headers (*.* instead of an explicit text/html) which can cause undesired behavior in Rails. Someone suggested manually setting the format in a before_filter:

    params[:format] ||= 'text/html'
    This was discouraged because it can cause problems elsewhere. A better solution was to put the html format at the top of any `respond_to` blocks:
    def show
      respond_to.html # run by default when type cannot be determined
      respond_to.js
    end
    
  • The Ruby MySQL Gem version 2.7 leaks memory for very large queries. The solution is to remove the 2.7 gem and manually install version 2.8 from source. This library is no longer a gem and must be installed from the mysql-ruby-2.8 tarball.

Ask for Help

"As a followup to Firefox SSL certificate problems..."

It turns out that our server running nginx had an old version of OpenSSL installed. Upgrading OpenSSL solved the problem.