May 26, 2010
Over the weekend I attended the fourth Gotham Ruby Conference (GoRuCo). The conference was well-organized, the content was top-notch and there were tons of great people there.
The day opened with a welcome from a Pace University’s Jonathan Hill. Jonathan, who is assistant dean of Pace’s Computer Science program, described the longstanding relationship between Pace and the New York Ruby community, pointing out that GoRuCo has been held at Pace since its first year. Pace uses Ruby and Rails extensively in its Computer Science program and, in turn, its graduates often find employment through this community. Jonathan expressed real appreciation for the health and energy of the Ruby community in New York. It was neat to feel this connection and know that Pace was more than just a rented space for the conference.
Nick Gauthier presented the first talk, Grease Your Suite, on making slow test suites run faster. This talk demonstrated how he improved a test suite in a Rails project from 13 minutes down to under 20 seconds. To do this, Nick used lifo’s fast_context, his own Hydra for distributing tests across CPU cores or machines, and Ruby Enterprise Edition for its ability to tune Ruby’s garbage collection. He also gained speed by mocking PaperClip’s image manipulation, using fixtures to replace truly-resized images. Nick got further performance by tweaking a journaling setting for the
ext4 filesystem (Nick is a staunch Linux-on-the-desktop user), as well as by disabling
atime. Nick noted that the improvements from these tweaks gain as much in speed as running tests on a solid state drive. With such a fast test suite, the Continuous Integration server can return to its true calling—ensuring a green build in a production-like environment. While I don’t have any projects that are burdened by tests that take too long, I nonetheless left this talk with strategies to grease my suite. Get all the details in Nick’s slides.
The next talk, by Aman Gupta, was on a new Ruby profiling tool, Memprof. Aman provided a tour of the tools he’d worked with for profiling Ruby’s memory use:
ObjectSpace.each_object, gdb.rb, bleak_house, and patching Ruby in order for it to provide heap dumps. These tools are all helpful, he said, but they require writing patching or running special versions of Ruby, or don’t provide complete enough information on the contents of the objects in memory or their context in code. Memprof, created by Joe Damato with contributions from Aman, solves the above problems: Installing it is simple (
gem install memprof), use is simple (
Memprof.dump_all, for example), it outputs to JSON, and provides all the necessary information and context about objects in memory, including references between objects. Memprof’s JSON output makes it easy to dump its output into a database like MongoDB, which memprof.com does. Aman’s talk struck at just the right level: deep enough to keep us interested, but not so deep as to lose the audience. And if you’ve ever checked out Aman and Joe’s blog you’ll know how deep this this rabbit hole goes. My thanks to Aman for that.
Managing Rubyists, a talk by Luke Melia, was directed at Ruby developers who manage a team. This was the only non-technical talk of the day and it was one of the highlights for me. In the talk, Luke laid out 15 principles or techniques for managers to follow for their team and its members to achieve happiness, motivation, productivity and growth. I was blown away by the care Luke took with this subject and the regard he has for the developers he works with. Luke takes his craft as a manager as seriously as Rubyists take their code. Check out Luke’s slides and notes for the details. If you’re a manager, be sure to check out Luke’s recommended reading.
Paul Dix, author of the forthcoming Service Oriented Architecture with Ruby on Rails, presented on how to create web service clients using ActiveModel to scale an app. This is not scaling an app for traffic, but how to scaling as complexity and team size grow. Paul demonstrated how to leverage ActiveModel to implement client models with validations, dirty tracking, callbacks and even persistence. If you are struggling to deal with complexity in a large application and to abstract components into separate services, Paul offers an excellent approach. Definitely look out for his book this August.
The last talk of the day, Scaling to Hundreds of Millions of Requests, was presented by James Golick. In this talk, James outlined how he improved performance and scaled a very active community site. James shared his experience moving from Amazon EC2 to physical hardware and the immense performance increase this brought. James also went over his trials with MongoDB and using MySQL “non-relationally” with Friendly before finally settling on Cassandra. As James argued in a recent blog post Cassandra is one of the NoSQL databases that truly scales horizontally. Look for James speaking further on this topic at Railsconf.
In all it was a great conference. Thanks to the conference organizers and hello to all the folks I met. And hello to all the folks I didn’t get a chance to meet but wish I had. Keep your eyes peeled on the conference site; videos will be posted in the next two weeks.