InfoQ

InfoQ

News

My Bookmarks

Login or Register to enable bookmarks for unlimited time.

The content has been bookmarked!

There was an error bookmarking this content! Please retry.

Monitoring Ruby

Posted by Werner Schuster on Dec 14, 2007

Sections
Development,
Architecture & Design
Topics
Ruby ,
Performance & Scalability ,
Debugging
Tags
DTrace ,
JRuby
A recent interview with Philippe Hanrigou goes into the topic of monitoring and troubleshooting Ruby. Figuring out why a Ruby process fails, has a memory leak or some performance issue, is important to keep applications running. Figuring this out fast is even more important, particularly if a production server has developed a problem and this is now impeding business.

Next to the basic Unix tools such as gdb or strace (a tool that shows the syscalls a program made by a program), DTrace is mentioned as a potentially useful tool. DTrace, tool that allows low-overhead profiling of and tracing of programs, was originally developed for Solaris. It has since been ported to and shipped with other systems, most recently to Mac OS X Leopard which includes DTrace support for the Ruby interpreter.

Philippe suggests a solution for Linux, a system where DTrace isn't supported yet:
For the most hardcore members of the community it might be worth investing some time and energy to help push SystemTap forward. Unfortunately, while many Ruby applications are deployed on Linux, DTrace is not available on this platform. Due to licensing and unresolved issues there is actually very little chance that DTrace will ever be ported to Linux in the foreseeable future. The closest alternative to DTrace on Linux is SystemTap, which shares the same objectives but is not quite as mature yet. In particular, SystemTap still does not seem to provide support for traces in user space programs.

Running Ruby apps on JRuby gives developers access to the host of profiling and monitoring tools available for the Java platform. Ola Bini mentioned this as an advantage some time ago in a blog post titled "Can your Ruby do this", where he uses JConsole (shipped with JDKs) to look inside a JRuby app. JConsole can attach to a running JVM and - using JMX - access information such as Garbage Collection information (generation sizes, collection runs, etc.), thread information and all other information exposed through MBeans. Philippe also mentions another tool to deal with memory leaks:
Finally, when it comes to memory leaks, the usual Java tools also come to the rescue. A useful technique is to get a heap dump with jmap and then inspect it with jhat or any standard Java heap dump analyzer. Give the SAP Memory Analyzer a try—Ola had a great experience with it.
InfoQ recently discussed some free memory analyzer tools from SAP or IBM.

Philippe finishes by expressing his interest in Rubinius:
Finally building troubleshooting tools for Ruby would be a lot easier if any Ruby developer could easily access the Ruby interpreter to instrument and extend it. This is why I consider the success of a project such as Rubinius to be the best way for take the platform to a whole new level in the long term. Any time and effort that the community invest in Rubinius will be well spent.

No comments

Watch Thread Reply

Educational Content

10 tips on how to prevent business value risk

One category of risk that project teams need to ensure they address is business value failure – delivering a product that fails to provide value for the business investor.

Interview: Software Systems Architecture: Working With Stakeholders Using Viewpoints and Perspectives

InfoQ spoke to the authors of Software Systems Architecture on a couple of new topics, the System Context viewpoint and Agile, which have been added to the second edition.

Beauty Is in the Eye of the Beholder

Alex Papadimoulis discusses ugly code, where it comes from, how to avoid it, and how to get rid of it.

Architecting Visa for Massive Scale and Continuous Innovation

John Davies examines Visa’s architecture and shows how enterprises have architected complex integrations incorporating Hadoop, memcached, Ruby on Rails, and others to deliver innovative solutions.

Max Protect: Scalability and Caching at ESPN.com

Sean Comerford unveils ESPN.com’s architecture, what components are used and why, and the current changes the website goes through.

The Seven Deadly Sins of Enterprise Agile Adoption

Are there repeated patterns of failure on Enterprise Agile Enablement efforts? Sanjiv and Arlen discuss Seven Deadly Sins to avoid when adopting Agile in an enterprise.

Questions for an Enterprise Architect

Erik Dörnenburg answers: What is Enterprise and Evolutionary Architecture?, discussing 4 issues: Turning strategy into execution, Ensuring conformance, Where do the architects sit? Buying or building?

Wrap Your SQL Head Around Riak MapReduce

Sean Cribbs explains what Map-Reduce and Riak are, why and how to use Map-Reduce with Riak, and how to convert SQL queries into their Map-Reduce equivalents.