Question

I have a Ruby on Rails app, and I want to monitor the GC with New Relic. The documentation on how to do this is very scarce.

I already have New Relic collecting data from my app. What I want is to add GC profiling. Can anyone explain to me how this is done?

Was it helpful?

Solution

You can enable GC profiling instrumentation in New Relic using one of these calls in your application initialization:

  • MRI 1.9.2 or higher: GC::Profiler.enable
  • Ruby Enterprise Edition: GC.enable_stats

For your Rails application, you can either add this call to an initializer in config/initializers, or add it directly to your config/application.rb file.

You can find more information on this at Ruby agent: Garbage collection.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top