Slow Actions in Rails Projects

March 13th, 2009 by

MySQL’s slow query log is a very handy tool to detect which SQL queries are running slowly in a production app.

So what about rails applications? Often, test data only contains a small amount of data. Over time more users use the site and generate more data. A page that usually renders in 100ms could be taking 3-5 seconds, or more!

I present, SlowActions. The goal was to analyze a standard log file to detect actions that render slowly. It had to be easy to use and also not require modification of rails’ logging mechanism. Observe:

  $> slow-actions --actions development.log
             Cost    Average Max
  - UsersController : game_history (22 entries, 0% Error)
    Total:   11275.447 3642.437 12728.0
    Render:  7.20300 2.32700 17.2450
    DB:      10.5020 3.39200 10.0000

  - QuestionsController : refresh_index_table (89 entries, 0% Error)
    Total:   908.494 202.348 307.000
    Render:  0.00000 0.00000 0.00000
    DB:      32.5880 7.25800 10.0000

More info after the break ….
Read the rest of this entry »

Recap of the First Baltimore Angels Meetup

March 5th, 2009 by

As many of you know, Baltimore Angels is a group of individual angel investors that have come together as a loose federation whose primary purpose is to spur continued and sustained economic and technological development in this region. (Obviously, they’d like to make a little coin too.) Last month, Baltimore Angels made a public call for business ideas and received 51 submissions in only a few weeks. How encouraging for Baltimore!

Yair and I submitted MyStudentGroups, a web application we built that is currently being used by Johns Hopkins to facilitate the administration of more than 300 student organizations at Hopkins. Among other group management features, it provides a budget management component that takes a lot of the paperwork out of allocating and utilizing a group’s budget. Most importantly, it serves as the official mechanism by which Hopkins recognizes their student groups.

I don’t intend to go into much detail about our specific idea. Rather, my intentions are to (a) document our experience for the benefit of interested entrepreneurs, and (b) provide an honest critique of the process. Read the rest of this entry »