Ruby: can GC :: Profiler.enable in a production environment cause performance problems?

Can activating GC :: Profiler in ruby ​​1.9.2 in a production environment cause performance issues? Can I use it in a critical production application?

+7
source share
1 answer

Simply enabling GC::Profiler should not result in poor performance, but the question is what you plan to do with it.

Compare it with Rails.config.log_level . If you set the level too high (for example :notice ), it needs to write many files to the log file, which will lead to a significant increase in I / O than is necessary, and, thus, to a decrease in performance. This is why the logger is set to :debug during production to minimize I / O.

So, if you turn on GC::Profiler and just ask for specific results in emergency scenarios, then I don’t believe that the problem should be the problem, it’s when you start to abuse the profiler that things can start to slow down.

but this applies to everything from overuse of database queries, to overuse of complex code to overuse of images, etc.

+5
source

All Articles